REFERENCE
SDK Demos
How to use @asgard-js/core and @asgard-js/react, with demos you can try on the page.
Events
Handle EMIT actions dispatched by message template buttons. Use
onTemplateBtnClick to receive every click with its eventName and
payload.
Code Example
<Chatbot
onTemplateBtnClick={(payload, eventName, raw) => {
console.log(eventName, payload, raw);
// route to your own handler / analytics / navigation
}}
{...rest}
/>onTemplateBtnClickParametersParameter Type Description 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, andtype: "message"sends a message.Related docs
- Action Object - EMIT — Field definitions for the
emitaction'seventNameandpayload
- Action Object - EMIT — Field definitions for the