JavaScript SDK Reference
Full reference for window.LumioWidget — every action, its signature, and a usage example.
JavaScript SDK Reference
All calls go through window.LumioWidget(action, ...args). The global is available after the loader script runs. Calls made before the loader is ready are queued and replayed automatically.
init
Initialise the widget and render the launcher.
LumioWidget('init', { widgetId: 'YOUR_WIDGET_ID' })| Option | Type | Default | Description |
|---|---|---|---|
widgetId | string | — | Required. Your widget id from the dashboard. |
display | object | — | Placement & launcher overrides — see below. |
position | 'left' | 'right' | 'right' | Legacy alias for display.position. |
Call init once, before any other SDK method.
display — placement & launcher
Every field is optional and overrides the dashboard default for that
field. Omit display entirely to let the dashboard own placement (recommended —
see Installing the Widget).
| Field | Type | Default | Description |
|---|---|---|---|
position | 'left' | 'right' | 'right' | Bottom-left or bottom-right corner. |
style | 'icon' | 'text' | 'iconAndText' | 'manual' | 'icon' | Launcher style. manual renders no button — open the widget yourself via open(). |
iconImage | 'message' | 'search' | 'question' | 'buoy' | 'message' | Glyph for icon / iconAndText. |
text | string | 'Help' | Label for text / iconAndText. |
size | number | 60 / 48 | Launcher size in px (icon side / pill height). Clamped 36–96. |
horizontalOffset | number | 20 | Pixels from the chosen corner. |
verticalOffset | number | 20 | Pixels from the bottom. |
horizontalMobileOffset | number | — | Mobile override (falls back to desktop). |
verticalMobileOffset | number | — | Mobile override (falls back to desktop). |
LumioWidget('init', {
widgetId: 'YOUR_WIDGET_ID',
display: { position: 'left', style: 'iconAndText', text: 'Help', iconImage: 'question' },
})Precedence: dashboard default → snippet display override → manual.
config
Update placement & launcher at runtime. Accepts the same display object as
init (merged into the current config) and re-renders the launcher in place.
LumioWidget('config', { display: { position: 'left', style: 'manual' } })identify
Associate the current browser session with a logged-in user.
LumioWidget('identify', {
userId: 'user_123',
signature: '<server-computed hmac>',
name: 'Alice',
email: 'alice@example.com',
properties: { plan: 'pro' },
})| Option | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | Your internal user id. |
signature | string | Yes | HMAC-SHA256 of userId, signed with your widget signing secret. Must be computed server-side. |
name | string | No | Display name. |
email | string | No | Email address. |
properties | object | No | Free-form key/value pairs used for announcement targeting. |
See Identifying Users for the server-side signing example.
open / close / toggle
Programmatically control the widget panel.
LumioWidget('open') // open the panel
LumioWidget('close') // close the panel
LumioWidget('toggle') // toggle open/closednavigate
Navigate to a top-level surface inside the panel.
LumioWidget('navigate', '/updates') // open Product Updates
LumioWidget('navigate', '/docs') // open DocsAccepted routes: '/updates' | '/docs'.
article
Open a specific doc by its slug or page id (copy a ready value from the dashboard under Widget → Install → Contextual links).
LumioWidget('article', 'settlement-tats') // focused sheet (default)
LumioWidget('article', 'settlement-tats', { type: 'sidebar' }) // full panel
LumioWidget('article', 'settlement-tats', { type: 'modal' }) // centered modal
LumioWidget('article', 'settlement-tats', { type: 'popover' }) // corner card| Option | Type | Default | Description |
|---|---|---|---|
type | 'sheet' | 'sidebar' | 'modal' | 'popover' | 'sheet' | How the doc is presented. sheet is a focused side panel (desktop) / bottom sheet (mobile). |
Use this for contextual deep-links from your UI. For plain links you can also use
the zero-JS data-lumio-article attribute.
search
Open Docs with a pre-filled search query.
LumioWidget('search', 'billing')suggest
Show contextual doc suggestions — up to 10 articles surfaced near the launcher.
LumioWidget('suggest', ['PAGE_ID_1', 'PAGE_ID_2', 'PAGE_ID_3'])Pass an array of Notion page ids (max 10). Useful for surfacing relevant help based on what the user is currently doing.
event
Report a SPA route change so Lumio can evaluate URL-based announcement targeting.
LumioWidget('event', {
type: 'page-viewed',
url: window.location.href,
title: document.title,
})Call this after every client-side navigation.
announce
Manually trigger an announcement by id.
LumioWidget('announce', 'ANNOUNCEMENT_ID')
// With options
LumioWidget('announce', 'ANNOUNCEMENT_ID', { delay: 2000, force: true })| Option | Type | Description |
|---|---|---|
delay | number | Milliseconds to wait before showing. |
force | boolean | If true, overrides frequency limits and shows regardless of prior views. |
on / off
Subscribe to or unsubscribe from widget events.
LumioWidget('on', 'open', () => console.log('widget opened'))
LumioWidget('off', 'open', handler)Available events
| Event | Fires when |
|---|---|
ready | The widget has loaded and is ready |
open | The panel opens |
close | The panel closes |
unread-changed | The unread count changes |
article-viewed | A Docs article is opened |
announcement-shown | An announcement is displayed |
announcement-clicked | The announcement CTA is clicked |
announcement-closed | The announcement is dismissed |