Events
This section describes the events available on WebChat via the SDK
Adding an event listener
webchat.on('event_name':string, callback: Function)/**
* Add an event listener to the chat widget
* @function on
* @param {string} eventName - the event to listen for
* @param {Function} callback - the function to call when the event is triggered
* @returns {CustomEvent} - the event object with specific data in the event.detail object
*/
.on('loaded', (e: CustomEvent) => {
console.log(e.detail) // the event data specific to WebChat
})Supported events
Last updated