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.
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
Install dependencies
Installs the pinned Glean Web SDK, React, and Vite dependencies.
cd embed-search-chat && npm install
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>"
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.
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
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.
- 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
agentIdto 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.
Paste into Claude Code, Cursor, or Codex.
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.