Initialization
Methods
widget.open()
Opens the chat frame. No-op if already open.
widget.close()
Minimizes the widget back to the bubble. No-op if already closed.
widget.toggle()
Toggles between open and closed states.
widget.hide()
Hides the entire widget (bubble + frame) from the page. Useful for conditionally showing the widget based on user state.
widget.show()
Shows the widget again after hide().
widget.destroy()
Removes the widget from the DOM entirely and cleans up event listeners.
Events
Listen for widget lifecycle events:| Event | Description |
|---|---|
open | Widget frame opened |
close | Widget frame closed |
ready | Chat iframe finished loading |
messageSent | User sent a message in the chat |