Skip to main content

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.

Internal appYour existing frontend
Glean Web SDKsearch + chat UI
AuthSSO or scoped token
Gleanpermission-aware index
A Glean instance with content indexed
Your Glean web app domain (typically app.glean.com — see admin/about-glean)
A frontend app or page where you can add a script tag and a container element
For token auth only: an admin API key from the Token Management page
1

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>
2

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 });
},
});
3

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);
4

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.

Take it further
Hand off context between search and chat so a search result opens a grounded conversation (separate pages for chat and search).
Scope chat to your app's context by passing an AI App applicationId to the chat component.
Go tokenless for guests with the Web SDK's guest auth provider for public-facing deployments.
Add the Modal Search or Sidebar variants for search anywhere in the app.

Copies a prompt your AI assistant can build from.

At a glance
SurfacesWeb SDK
StatusProduction pattern
Time~15 min (minimal)
Required scopes
SEARCHCHAT