Skip to content
Docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Widgets

Build interactive cards that appear under your agent’s replies after an API action or when a widget condition matches.

A widget is an interactive card under an agent reply. It can show an order status, a list of products, collect information, or give visitors buttons to choose what happens next. You build it for one agent under Build > Widgets. An enabled widget can appear after a successful API response from a Custom API action, or on its own when its When to show condition matches. Several actions can use the same widget.

Start from a template to fill in a widget’s code, fields, examples, functions, and states without AI or credits.

Visitors see the card and its buttons, alongside the agent’s answer. For example, a reply about an order can include this card:

<Card>
  <Title value="Your order" />
  <Text value={order.status} />
</Card>

Show a widget

There are two ways a widget can appear:

How it appears What happens
From a Custom API action The action calls your API through a saved API connection. It shows the selected widget after a successful JSON response if the widget is enabled. Failed requests and text responses do not show a widget.
From a widget condition Enable the widget, then set When to show in its Settings tab. When a visitor’s message matches, the widget can appear without a Custom API action.

If no Custom API action selects the widget, leaving When to show empty lets the agent decide when to show it. A widget selected by an action cannot also appear on its own.

The widget’s Fields define which data reaches visitors. Chatvox takes data in this order:

  1. The widget’s Default example supplies starting values.
  2. The Custom API action’s input fields replace those values where provided.
  3. The API response data, selected by the action’s Data path, replaces those values where provided.

Each source is restricted to the widget’s declared fields before merging. Nested objects merge key by key. Lists and individual values are replaced. The response wins when sources provide the same value.

For example, declare order.status and order.number. A default example can provide:

{
  "order": { "status": "Preparing", "number": "Not provided" }
}

If the API supplies {"order":{"status":"Shipped","number":"A-1234","internal_note":"Review"}}, the visitor receives status and number, but not internal_note.

What the AI can see controls the JSON response fields used in the agent’s answer: All fields or Only selected fields. The widget uses its own fields independently. Restricting the AI’s fields does not restrict the widget’s fields.

Named examples, such as a shipped-order example, only affect the builder preview.

How widgets use the allowance

Each agent has one Actions & Widgets per agent allowance: Free 0, Starter 5, Standard 8, and Pro 12.

Configuration Slots used
Enabled action, including an MCP Server action with multiple tools 1
Enabled widget not selected by any Custom API action, with or without When to show text 1
Widget selected by any Custom API action, including a disabled action 0 extra; it cannot appear on its own
Additional functions on a widget 0 extra slots
Saved but disabled action or standalone widget 0 active slots
Reusable API connection 0
Escalate to Human (requires Standard or above) 1

An enabled Custom API action and its linked widget use one slot together. Adding When to show text to that widget does not add a slot or enable standalone display.

At capacity, save new actions or standalone widgets as disabled drafts. The Actions and Widgets pages show the same used and allowed count. After a downgrade, saved configuration remains, but capabilities beyond the allowance do not run. The oldest enabled items receive slots first. The list marks unavailable items Not running, or Not running on its own for standalone widgets.

How widget code stays limited

Widget code looks like JSX, but Chatvox never runs the source as JavaScript. The builder turns it into a component tree. The server checks that tree against an allowlist on every save. The visitor’s browser draws the checked tree using the fixed component library.

Field reads, .map() loops, template strings, comparisons, &&, ||, !, and ternaries are supported. Arbitrary JavaScript, scripts, and other function calls are refused.

Visitors never receive the API endpoint, request headers, credentials, widget source, or named examples. They do receive the declared data, rendered component tree, states, and supported function settings. Keep secrets out of text, default data, Open link URLs, and messages.

Where widgets appear

Widgets appear in the web widget, Public Chat, and the Playground. They do not render on WhatsApp, through the REST API, or in an action’s test request. Custom API actions can still call their API on WhatsApp and through the REST API; those channels do not display the widget. A widget’s When to show condition is available in the web widget, Public Chat, and Playground.

Widgets use the chat theme’s colors and the agent’s accent color. Public Chat supports Light, Dusk, and Midnight themes. The builder preview stays light.

Saved state and reply copies

Functions can set local variables or dismiss a widget. Chatvox saves those changes with that specific reply, so they survive a conversation reload. A Send message function adds a message as the visitor.

Each reply keeps its own copy of the widget and its data. Editing or deleting a widget or action does not change cards in earlier replies. In Activity > Logs, you can inspect a read-only copy labeled Shown to the visitor or Dismissed by the visitor.