widget.on).
Hooks
Pass callbacks throughconfig.hooks:
Event emitter
The widget extends an event emitter. Subscribe withwidget.on and clean up with widget.off.
| Event | Payload |
|---|---|
stateChange | (from: WidgetState, to: WidgetState) |
contextChange | (event: ContextChangeEvent) |
nudgeShown | (nudge: NudgeData) |
quickAction | (action: QuickActionType) |
authFailed | () — fires after any SDK request returns 401. The widget hides itself automatically; subscribe to this event to drive the host’s re-auth flow. |
mounted | (container: HTMLElement) |
shown | () |
hidden | () |
destroyed | (container: HTMLElement | null) |