Skip to main content

REFERENCE

SDK Demos

How to use @asgard-js/core and @asgard-js/react, with demos you can try on the page.

Message Actions

Add custom action buttons below each bot message — useful for thumbs up/down feedback, copy, share, and more.

  1. Example​

    <Chatbot
    messageActions={(message) => [
    { id: "copy", label: "📋 Copy" },
    { id: "thumbs-up", label: "👍" },
    { id: "thumbs-down", label: "👎" },
    ]}
    onMessageAction={(actionId, message) => {
    console.log(actionId, message.messageId);
    // Send to your analytics / feedback API
    }}
    {...rest}
    />
  2. MessageActionConfig​

    FieldTypeDescription
    idstringUnique action ID
    labelstringButton display label

    messageActions is a function that receives a ConversationBotMessage and returns MessageActionConfig[]. You can vary the actions based on message content.

Ready to get started?

Want to see how Asgard fits your team? Talk to us.

Contact us