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 install an npm package (or add a script tag) and a container element
For token auth only: an admin API key from the Token Management page
1

Install the Web SDK: add the npm package to your app. It ships TypeScript types for every component and option.

npm install @gleanwork/web-sdk

No build toolchain (CMS, portal, SharePoint)? Load the SDK from your Glean domain with a script tag instead — the same methods appear on window.GleanWebSDK. See the Web SDK overview.

2

Render search: add a search box and a results container, then render both components. Setting backend is recommended — it routes users straight to your instance instead of asking for their email. See the Autocomplete + Search Page guide for the full options.

import { renderSearchBox, renderSearchResults } from '@gleanwork/web-sdk';

renderSearchBox(searchBoxElement, {
backend: 'https://{your}-be.glean.com',
onSearch: (query) => {
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.

import { renderChat } from '@gleanwork/web-sdk';

renderChat(containerElement, {
backend: 'https://{your}-be.glean.com',
});
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 a specific agent by passing its agentId 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