Browse topics Website chat widget
Connect your app
Website chat widget
Add the widget and set its colors, theme and behavior.
Set shared business hours in Account settings, then inherit, override or turn them off for each project under Website chat. Outside these hours, visitors can leave a message and, if enabled, an optional email for private manual follow-up. This does not send email or guarantee a live response. Availability is returned in the chat configuration as business_hours.
Choose the layout, scroll reveal, button text and light/dark colors in your website's embed code. Appearance stays on your website. Enable chat and allow website origins in Project settings → Website chat; messages are still saved to your installation.
<div id="suggestion-box-chat"></div>
<script type="application/json" id="suggestion-box-appearance">
{
"launcherText": "Talk to the Glean team",
"title": "Glean support",
"theme": {
"mode": "auto",
"light": { "accent": "#37306B", "onAccent": "#FFFFFF" },
"dark": { "accent": "#E7E1FF", "onAccent": "#221C43" }
}
}
</script>
<script defer src="https://box.example.com/widget.js"
data-server="https://box.example.com" data-project="your-project"
data-target="#suggestion-box-chat"
data-config="suggestion-box-appearance"></script>
Replace the server and project with those from your project's installation snippet. data-config names the JSON element's ID, without #. The JSON controls appearance; the script's data-server, data-project, and data-target still select where chat connects and mounts.
Bubble, bottom bar, or inline
Add presentation to the appearance JSON or manual mount options: "bubble" keeps the bottom-right launcher (the default), "bar" uses a centered floating bottom bar, and "inline" puts a bar exactly where your target div lives. Only the inline launcher follows the div’s width. The conversation opens above the page, bottom-right on desktop and almost full-screen on mobile. Opening and closing do not move surrounding content.
{
"presentation": "bar",
"revealAfterScroll": 600,
"launcherText": "Ask us anything…"
}
For floating layouts, revealAfterScroll is a positive number of pixels scrolled down the main document. Once revealed, chat stays available when scrolling back up. Omit it or use 0 to show immediately. Inline ignores this setting. Invalid values use immediate display; unknown presentations use the bubble. Choose a reachable threshold for short pages. Reveal does not steal focus and respects reduced motion.
Bars are buttons that open the same conversation and focus its message field. They default to Ask a question…. Your own support button can call SuggestionBoxChat.get('#suggestion-box-chat').open() to bypass the scroll threshold; .close() closes without clearing the draft. Mount one widget per page. All layouts share the same chat session; appearance options are read at mount time.
Light, dark, or automatic
theme.mode accepts auto, light, or dark. Automatic mode follows the operating system. Each palette supports accent, onAccent, background, surface, text, muted, and border. Use #RGB or #RRGGBB colors; omitted or invalid values keep the built-in defaults. Choose readable color pairs.
For your own website theme toggle, call this after the widget loads. It preserves the conversation and draft:
SuggestionBoxChat.get('#suggestion-box-chat').setTheme('dark');
// Use 'light' for light mode, or 'auto' to follow the operating system.
Opening and closing animate gently. Reduced-motion preferences are respected automatically.
Mount from your JavaScript
Alternatively, load widget.js without data-* attributes, then mount it after the script and target element are ready:
const chat = SuggestionBoxChat.mount('#suggestion-box-chat', {
server: 'https://box.example.com',
project: 'your-project',
launcherText: 'Talk to the Glean team',
theme: {
mode: 'auto',
light: { accent: '#37306B', onAccent: '#FFFFFF' },
dark: { accent: '#E7E1FF', onAccent: '#221C43' },
},
});
chat.setTheme('light');
Choose automatic embed or manual mount so the target is mounted once. Labels render as plain text, up to 80 characters for launcherText and 120 for title. Omitting them keeps Chat with us for the bubble, Ask a question… for bars, and the project's name as the panel title. Never put a project API credential in your website code.
Episode-aware AI chat
Pass the episode on the page to your existing widget and answer from public transcript tools. See the MCP integration guide for context, source links and player callbacks.
These docs describe the current source. Check your server’s /api/v1/openapi.json for the version you run.