Skip to main content

Web SDK

Six components, one SDK

The previews below are illustrative, rendered with sample data from a fictional engineering portal — in your app, each component renders live against your organization's Glean instance.

Quickstart

A search box in three steps

  1. 1Add the SDK — install @gleanwork/web-sdk from npm, or load the script tag from your Glean web app domain.
  2. 2Render a container element with position: relative and display: block.
  3. 3Call renderSearchBox — users sign in with your existing SSO, and every result respects their permissions. See Authentication for token-based options.
search.ts
import { renderSearchBox } from '@gleanwork/web-sdk'

renderSearchBox(document.getElementById('search'), {
  backend: 'https://acme-be.glean.com/',
  onSearch: (query) => {
    location.assign('/search?q=' + encodeURIComponent(query))
  },
})

Works where your team works

Step-by-step guides for the platforms teams embed Glean into most.

Authentication

Widgets authenticate real users, so every search result and chat answer is scoped to what that person can already see.