Widget
A sticky, conversational AI sidebar with a floating trigger button. The default placement in auto mode, with no target element or configuration required.
The Widget placement is a sticky, conversational AI panel with a floating trigger button. Readers click the trigger to open a sidebar and ask questions scoped to the page content. It's a body-level placement, so it attaches directly to document.body and needs no target. The Widget is the default placement in auto mode. If you've pasted the embed snippet, this is the AI feature that appears on your site.
Mounting programmatically
In programmatic mode, a single mount() call is all it takes: no target, no required options.
window.InlineAI.mount(window.InlineAI.Placement.Widget);The call returns a placement ID you can pass to unmount() later. See the programmatic control guide for mount/unmount patterns and SPA routing.
Opening and closing from your own code
Use window.InlineAI.open() and window.InlineAI.close() with OverlayTarget.Widget to drive the sidebar from your own UI, for example a CTA button or a keyboard shortcut.
// Open the sidebar
window.InlineAI.open(window.InlineAI.OverlayTarget.Widget);
// Close it
window.InlineAI.close(window.InlineAI.OverlayTarget.Widget);document.getElementById('open-assistant').addEventListener('click', function () {
window.InlineAI.open(window.InlineAI.OverlayTarget.Widget);
});Events
The SDK emits WidgetOpen and WidgetClose when the sidebar opens and closes. Use them to sync your own UI state, for example to pause a video when the panel opens.
var { Events } = window.InlineAI;
window.InlineAI.on(Events.WidgetOpen, function () {
console.log('Widget panel opened');
});
window.InlineAI.on(Events.WidgetClose, function () {
console.log('Widget panel closed');
});See the events reference for payload shapes and the full event catalog.