Fetch data before showing and Call an API on response live in the component’s Advanced settings; the rest is set under a button’s When tapped.
Before you start
A saved component
Everything here is set in its builder under Embed & Widgets → Components.
A 2.0 widget version
Components and agent actions run from a
2.0.0-beta build.Fetch data before showing
The request runs when the component is sent, and the response is available to blocks as${{api_res.…}}. Use it for anything that must be current: live pricing, the visitor’s open orders, slots that are still free.
Set the method (GET, POST, PUT or PATCH), the URL, and rows for headers, query params and body. There is no separate auth setting, so add an Authorization header row. In the request you can use your component parameters and the agent’s variables as ${{custom_args.<name>}}.
Once the URL is set, blocks can bind to the response:
A binding can sit inside a longer string, such as
₹${{plan.premium}}/mo.
Call an API on response
This request fires when the visitor taps a Send to agent button. It takes the same method, URL, header, query and body fields, and offers these bindings:Submit a form
There is no separate submit action. A Send to agent button inside aform block also submits that form’s named inputs. The widget sends the agent the button’s Action ID, its Value if set, and the input values:
Fire an event on your page
Set When tapped to Page event and enter an Event name. The name is lowercased, spaces become_, and only a-z, 0-9, _, - and : are kept. A tap dispatches a CustomEvent with that name on window; event.detail carries the button’s value and action_id.
Open a link
Set When tapped to Open a link for a brochure, a policy PDF, a payment page or a phone number. Enter the URL; Open in new tab is on by default. The URL must start withhttps://, mailto: or tel:, or be a binding such as ${{api_res.brochure_url}}. Return the full URL from your API when it differs per visitor or plan.
Opening a link tells the agent nothing. Put a Send to agent button next to it when the agent should follow up.
Render an image
Theimage block takes a url and an optional alt. Set a width or height in the inspector. To show an image from your API, bind the URL to the complete address your API returns:
Parameters
Parameters are values filled in each time the component is shown, such as the plans to compare or the order to display. Add them under Parameters with a key, a description and a type:string, number, boolean, array or object. Keys keep only a-z, 0-9 and _.
What you can bind to
An input’s name is not a binding: you can’t show what the visitor typed in another block. Input values reach the agent and your API only after a submit.
Agent actions
An agent action lets the agent fire a browser event on your page during a conversation, with nothing for the visitor to tap: focus the search box, open a promo modal, scroll to pricing. Actions are configured in the Execute DOM Action legacy widget, so they are available only on agents that already have one under Embed & Widgets → Components → Legacy widgets. The web widget runs them from CDN version2.0.0-beta.
Each entry under Actions has:
When the agent fires an action, the widget dispatches a
CustomEvent on window named after the Event ID. event.detail holds the payload fields plus action_id.
eventLogs: { enabled: true } to loadAgent. Each fired action then shows as a pill in the chat (Triggered and the event name), and failures show as Event missing name or Action failed. Add showIds: true to include the action ID.
Prefix Event IDs with your own namespace (shop_…) so they don’t collide with other events on the page. These are separate from the widget’s own lifecycle events.
Verify the wiring
- With your real endpoint in Fetch data before showing, the component shows live values and no raw
${{…}}. - A Send to agent tap reaches your Call an API on response endpoint with the expected input names.
- Each Page event and agent action has a listener, and fires once per tap or action.
Next steps
Copy a recipe
Lead capture, live pricing, downloads and more.
Prepare for launch
Domains, , versions and browser QA.