Skip to content

Rich actions

Buttons and other rich elements carry an action. Each action has a type. The SDK handles open_url, send_message and change_language itself; callback and request_input are routed into your app.

Action typeFieldsWhat happens
open_urlurl, show_in_app?Opens the URL (in-app browser or external).
send_messagemessage, show_in_chat?Sends a message as if the user typed it. show_in_chat:false sends it silently (no user bubble).
change_languagelocaleRe-localizes the entire chat UI to locale.
callbackcallback_id, payload?Forwarded to your app via onRichContentCallback (or the platform equivalent). Run native code — open a screen, add to cart, etc.
request_inputinput_type, source?Asks the SDK to open its input picker (e.g. image).

Button styling

A RichButton wraps an action and adds:

FieldTypeNotes
labelstringButton text.
styleprimary|secondary|…Visual weight (maps to the tenant palette).
actionRichActionThe action fired on tap.

Handling callback in your app

The bot may only emit callback_ids you support. Advertise them via userContext (e.g. supported_callbacks) so the model never invents ids your app can’t dispatch. See Host callbacks & actions for the wiring per platform.

onRichContentCallback: (callbackId, payload) {
switch (callbackId) {
case 'open_design': openDesign(payload?['design']); break;
case 'open_paywall': showPaywall(reason: payload?['reason']); break;
}
}