Events
Handle EMIT actions dispatched by message template buttons. Use
onTemplateBtnClick to receive every click with its eventName and
payload.
Event Logs
No events captured yet.
Click the Book Ticket button in the chatbot to trigger an EMIT event.
Loading chatbot...
Code Example
<Chatbot
onTemplateBtnClick={(payload, eventName, raw) => {
console.log(eventName, payload, raw);
// route to your own handler / analytics / navigation
}}
{...rest}
/>
onTemplateBtnClick Parameters
| Parameter | Type | Description |
|---|---|---|
payload | Record<string, unknown> | Payload data defined on the button |
eventName | string | Event name defined on the button |
raw | string | Raw message JSON string |
Only type: "emit" buttons trigger this callback. type: "uri" opens a link directly, and type: "message" sends a message.
Related docs
- Action Object - EMIT — Field definitions for the
emitaction'seventNameandpayload