Web SDK
Embed Glean anywhere
Drop permission-aware search, AI chat, and contextual recommendations into any internal surface. Every component is a one-line render call backed by your organization's Glean instance.
Six components, one SDK
The previews below are illustrative, rendered with sample data from a fictional engineering portal — in your app, each component renders live against your organization's Glean instance.
Glean ChatA full AI assistant grounded in your company knowledge, with citations back to the source.renderChat(element, options)
Search box + resultsCompose an autocomplete search box with a full results page for a custom search experience.renderSearchBox(element, options)
Modal SearchAttach a complete search overlay to any input on your page — one method call.attach(inputElement, options)
RecommendationsContextual suggestions for the current page, with a built-in search box.renderRecommendations(element, options)
Glean SettingsBetaLet users connect personal datasources like GitHub and Slack without leaving your app.renderSettings(element, options)
Sidebar SearchDeprecatedA slide-out Glean Assistant panel with chat and search.openSidebar(options)
Quickstart
A search box in three steps
- 1Add the SDK — install
@gleanwork/web-sdkfrom npm, or load the script tag from your Glean web app domain. - 2Render a container element with
position: relativeanddisplay: block. - 3Call
renderSearchBox— users sign in with your existing SSO, and every result respects their permissions. See Authentication for token-based options.
search.ts
import { renderSearchBox } from '@gleanwork/web-sdk' renderSearchBox(document.getElementById('search'), { backend: 'https://acme-be.glean.com/', onSearch: (query) => { location.assign('/search?q=' + encodeURIComponent(query)) }, })
Works where your team works
Step-by-step guides for the platforms teams embed Glean into most.
ReactWrap the SDK in components and hooks for your React app.SharePointShip Glean search inside SharePoint with an SPFx web part.ZendeskAdd Glean to your help center theme and agent workspace.LumAppsEmbed Glean widgets in your LumApps intranet pages.BrightspotIntegrate Glean search into Brightspot-powered sites.
Authentication
Widgets authenticate real users, so every search result and chat answer is scoped to what that person can already see.
SSO by defaultNo extra setup — users sign in with your existing identity provider the first time a widget loads.Server-to-server tokensMint short-lived user tokens on your backend and pass them to the SDK for a fully seamless session.Third-party cookiesUnderstand how browser cookie policies affect embedded sessions, and how the SDK handles them.