Listen to an event
All events
typeis the message type:text,image,audio,video,file…previewis the first 140 characters of a text reply, and empty for media.operatorNameis the first name of the person who replied, ornullfor bots and AI agents.error.codeis one ofinvalid_params,invalid_payload,unknown_commandorconnection_failed.
Unread count
A reply counts as unread while the chat isn’t on screen: closed, in a tab that isn’t focused, or (on the website) in a browser tab in the background. Showing the chat resets the count to 0.preload() after login so the badge works before the user first opens the chat.
Examples
Send replies to your analytics
Close your own container when the user taps close
When you showTalquiChat / <TalquiChat> inside your own modal or sheet, close it on closeRequested: