Your team lives in an internal tool and context-switches to find answers. Instead of sending them elsewhere, bring Glean's answers into the app they already use — with permissions enforced per user, automatically.
Include the Web SDK: add the JavaScript client to the <head> of your
page, replacing GLEAN_APP_DOMAIN with your Glean web app domain.
<script
defer
src="https://{GLEAN_APP_DOMAIN}/embedded-search-latest.min.js"
></script>
Render search: add a search box and a results container, then render both components. See the Autocomplete + Search Page guide for the full options.
window.GleanWebSDK.renderSearchBox(searchBoxElement, {
onSearch: (query) => {
window.GleanWebSDK.renderSearchResults(resultsElement, { query });
},
});
Render chat: create a container element with position: relative,
display: block, and an explicit width and height, then render Glean Chat
into it.
window.EmbeddedSearch.renderChat(containerElement);
Authenticate users: with the default setup, users authenticate through your
company's SSO — no extra configuration. To skip the SSO prompt (or support
users without Glean accounts), use
server-to-server authentication:
your backend mints short-lived user tokens with an admin API key
(SEARCH and CHAT scopes). Keep that key strictly server-side.
Try it with a query like "What is our PTO policy?" — results reflect exactly what the signed-in user is permitted to see.
applicationId to the chat component.Copies a prompt your AI assistant can build from.