Events reference

Complete reference for all Inline AI SDK events, including enum constants, raw string values, payload shapes, and ready-to-use code snippets for each event.

This page documents every event the Inline AI SDK emits, grouped by category. For each event you'll find the enum constant, its raw string equivalent, a description of when it fires, the shape of the data it delivers to your handler, and a usage example. For a conceptual introduction to the event system (including how on() and off() work), see Reacting to Inline AI events in your page.

Subscribing and unsubscribing

on(event, handler)unsubscribe

Registers a handler for the given event. Returns a function you can call to remove that specific listener.

// Using the return value to unsubscribe
var unsubscribe = window.InlineAI.on(window.InlineAI.Events.SearchOpen, handler);
unsubscribe(); // removes this listener only
ParameterTypeDescription
eventSDKEventName or Events.*The event to subscribe to
handlerfunctionCalled each time the event fires, receives the event payload

Returns: A zero-argument function that removes this listener when called.

off(event, handler)

Removes a specific handler by reference. You must pass the same function reference that was originally passed to on().

function handler(data) {
  console.log(data);
}
 
window.InlineAI.on(window.InlineAI.Events.SearchOpen, handler);
 
// Later: must be the same reference
window.InlineAI.off(window.InlineAI.Events.SearchOpen, handler);
ParameterTypeDescription
eventSDKEventName or Events.*The event to unsubscribe from
handlerfunctionThe exact function reference passed to on()

Anonymous functions cannot be removed with off() because each function literal creates a new reference. Use a named function or capture the unsubscribe return value from on() instead.


Lifecycle events

Lifecycle events tell you when the SDK is initialized and when publisher configuration has finished loading from the API.


Placement events

Placement events fire each time a placement is added to or removed from the page, whether by auto mode, programmatic mount() calls, or unmount().


Search events

Search events fire when the search overlay opens or closes. Use them to track search activity or synchronize your own UI.


Widget events

Widget events fire when the sticky Widget panel opens or closes.


All events at a glance

Enum constantRaw stringPayloadWhen it fires
Events.Ready'ready'noneSDK initialized; ready for mount() calls
Events.ConfigLoad'config:loaded'nonePublisher page config loaded from API
Events.PlacementMount'placement:mounted'{ id, type, container }A placement was added to the DOM
Events.PlacementUnmount'placement:unmounted'{ id, type }A placement was removed from the DOM
Events.SearchOpen'search:open'{ query }Search overlay opened
Events.SearchClose'search:close'{ method }Search overlay closed
Events.WidgetOpen'widget:open'noneSticky widget panel opened
Events.WidgetClose'widget:close'noneSticky widget panel closed

TypeScript type reference

If you're using TypeScript, the SDKEventName union type covers all valid event name strings:

type SDKEventName =
  | "ready"
  | "config:loaded"
  | "placement:mounted"
  | "placement:unmounted"
  | "search:open"
  | "search:close"
  | "widget:open"
  | "widget:close";
© 2026 Inline AI