Glean Chat
Glean Chat delivers personalized answers by integrating deep understanding of your company's content, employees, activities, and their interconnections. The system automatically tailors responses to each individual user's context and needs.
Implementation Guide
Adding the JavaScript Client
First, include the JavaScript library in the <head>
section of your page. Replace GLEAN_APP_DOMAIN
with your company's Glean web app domain (typically app.glean.com
or your-company.glean.com
if you use a custom subdomain).
The Glean web app domain differs from your company's Glean backend domain
(which typically follows the format your-company-be.glean.com
).
- HTML
<script
defer
src="https://{GLEAN_APP_DOMAIN}/embedded-search-latest.min.js"
></script>
Configuration and Setup
-
Create a container element with the following required CSS properties:
position: relative
display: block
- Defined
width
andheight
-
Render Glean Chat into your container:
- JavaScript
window.EmbeddedSearch.renderChat(containerElement);
For detailed configuration options and customizations, refer to our renderChat API documentation.
Implementation Recipes
AI Applications created using AI App Builder can be integrated into chat using
the applicationId
parameter.
Basic Implementation (Vanilla JavaScript)
Separate Pages for Chat and Search
This implementation creates dedicated routes for Search and Chat functionality:
- Search page:
https://example.net/search
- Chat page:
https://example.net/chat
Implementation Details
The implementation consists of separate components: - A Search page with the Glean Search component - A Chat page with the Glean Chat component - Automatic redirection to the Chat page when initiating new conversations
View a complete demo of this implementation in our CodeSandbox example.
Unified Page Implementation
This approach combines Search and Chat functionality on a single route:
- Single unified route:
https://example.net/search
- Toggle between views using a
mode
query parameter (search
orchat
) - Maintains both interfaces in one location for seamless user experience
View a complete demo of this implementation in our CodeSandbox example.