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
Browser SSOsigned-in user session
Gleanpermission-aware index
A Glean instance with content indexed
Your Glean Web app URL from Admin > About Glean > Web app URL
A frontend app or page where you can install @gleanwork/web-sdk@2.4.0 and add sized container elements
For the React variant: Node 20.19+ or 22.12+ and a signed-in Glean browser session
1

Copy the React example onto your machine

Creates an embed-search-chat folder in whatever directory you run this from. Every command after this one runs inside that folder.

npx -y tiged@2.12.8 --mode=git gleanwork/glean-cookbook/recipes/embed-search-chat/react embed-search-chat
2

Install dependencies

Installs the pinned Glean Web SDK, React, and Vite dependencies.

cd embed-search-chat && npm install
3

Find your Glean backend

Uses your email once to find the tenant backend and writes VITE_GLEAN_BACKEND to .env.local. If the backend is already known, set that variable manually instead. This is setup-time configuration, not a runtime tenant picker, and it does not request or store an API key.

npm run configure -- --email "<work-email>"
4

Configure the Web app URL and questions

Open .env.local. Set VITE_GLEAN_WEB_APP_URL to the exact value shown in Glean Admin > About Glean > Web app URL; keep backend and Web app URL as setup/deployment configuration rather than runtime user inputs. Set VITE_GLEAN_INITIAL_QUERY and VITE_GLEAN_INITIAL_MESSAGE to topics you know exist in your Glean content.

5

Open the page

Starts Vite and prints a Local URL. Open that URL in a browser where the user is signed in to Glean.

npm run dev
6

Verify search, chat, and the user boundary

Confirm autocomplete appears above Search Results, a known query returns accessible content with citations, and Chat answers the configured question. Repeat the check with a second authorized user and confirm neither Search nor Chat reveals content that user cannot access. If a vanity SSO hostname redirects an embedded frame to app.glean.com, confirm the exact Web app URL in Admin > About Glean; never proxy or frame the full app.

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.
  • Add the Modal Search or Sidebar variants for search anywhere in the app.

What's our PTO policy?

Returns a non-empty answer with at least one citation carrying a real title and URL, drawn from your own indexed content.

Who should I ask about billing?

Returns a non-empty answer with at least one citation carrying a real title and URL, drawn from your own indexed content.

Summarize our latest product update

Returns a non-empty answer with at least one citation carrying a real title and URL, drawn from your own indexed content.

View source

Paste into Claude Code, Cursor, or Codex.

Auth

This path uses your existing Glean browser session. Find the web app URL on the About page. The API server URL is a different field.

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