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 type | Fields | What happens |
|---|---|---|
open_url | url, show_in_app? | Opens the URL (in-app browser or external). |
send_message | message, show_in_chat? | Sends a message as if the user typed it. show_in_chat:false sends it silently (no user bubble). |
change_language | locale | Re-localizes the entire chat UI to locale. |
callback | callback_id, payload? | Forwarded to your app via onRichContentCallback (or the platform equivalent). Run native code — open a screen, add to cart, etc. |
request_input | input_type, source? | Asks the SDK to open its input picker (e.g. image). |
Button styling
A RichButton wraps an action and adds:
| Field | Type | Notes |
|---|---|---|
label | string | Button text. |
style | primary|secondary|… | Visual weight (maps to the tenant palette). |
action | RichAction | The 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; }}