Skip to main content

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

ParameterTypeDescription
payloadRecord<string, unknown>Payload data defined on the button
eventNamestringEvent name defined on the button
rawstringRaw message JSON string

Only type: "emit" buttons trigger this callback. type: "uri" opens a link directly, and type: "message" sends a message.