Sidebar Search
openSidebar is marked deprecated in the SDK's type definitions and will be
removed in a future version. For new integrations, consider the
Recommendations component for contextual suggestions or
Modal Search for on-demand search.
The Glean Sidebar opens a Glean Assistant panel — with chat and search — that slides out from the right side of your page.
Illustrative previewRendered with sample data — in your app, this component renders live against your organization's Glean instance.
Install the SDK
- npm
- Script tag
npm install @gleanwork/web-sdk
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).
<script
defer
src="https://{GLEAN_APP_DOMAIN}/embedded-search-latest.min.js"
></script>
The Glean web app domain differs from your company's Glean backend domain
(find yours at app.glean.com/admin/about-glean under "Server instance (QE)").
The same methods are available on window.GleanWebSDK once the glean:ready event fires.
Open the sidebar
Call openSidebar in response to a user action, such as clicking a button:
import { openSidebar } from '@gleanwork/web-sdk';
openSidebar({
backend: 'https://{your}-be.glean.com/',
});
The sidebar closes when the user clicks its close button or presses the escape key.
Options
openSidebar accepts SearchOptions:
| Option | Type | Description |
|---|---|---|
query | string | If provided, the sidebar opens showing results for this query. |
onSearch | (query) => void | Invoked when the user performs a search. |
datasourcesFilter | string[] | Restrict results to specific datasources, e.g. ['jira', 'confluence']. |
filters | FilterValue[] | Pinned, non-modifiable filters applied to every search. |
All components also accept the common Options — backend, authToken, theme, themeVariant, locale, and more.