Configuration callbacks
The simplest way to handle events is through callback functions in your configuration:Event listener API
For more control, use theon() and off() methods to subscribe to events dynamically.
on(event, handler)
Subscribe to an event.off(event, handler?)
Remove event listeners.Available events
Widget events
Chat events
Feedback events
Authentication events
Event payloads
chat:send
Fired when a message is sent.chat:complete
Fired when a response has finished.auth:ready
Fired when the widget has finished restoring or resolving the current auth state.auth:login
Fired when a user logs in.auth:logout
Fired when a user logs out.auth:sign-in-click
Fired when a user clicks a sign-in button inside the widget. UseauthClickEvents.mode to choose what happens next:
observekeeps the normal widget auth flowinterceptstops the normal widget auth flow so your page can handle auth itself
If you use
intercept, widget button clicks stop at the event, but voltai.login() and voltai.logout() still work normally.