Skip to main content

Sidebar Search

Deprecated

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.

portal.internal/engineering/runbooks/payments
Engineering PortalServicesRunbooksOn-call
ChatSearch
Ask Assistant anything
Reference current page
Ask Assistant anything…

Illustrative previewRendered with sample data — in your app, this component renders live against your organization's Glean instance.

Install the SDK

npm install @gleanwork/web-sdk

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:

OptionTypeDescription
querystringIf provided, the sidebar opens showing results for this query.
onSearch(query) => voidInvoked when the user performs a search.
datasourcesFilterstring[]Restrict results to specific datasources, e.g. ['jira', 'confluence'].
filtersFilterValue[]Pinned, non-modifiable filters applied to every search.

All components also accept the common Optionsbackend, authToken, theme, themeVariant, locale, and more.