What are remote interactions?
Remote interactions let your agent execute custom JavaScript code in the end-user’s browser during a live conversation. This enables your agent to interact with the webpage, access browser APIs, and perform client-side actions - like getting the user’s location, filling out a form, or reading data from the page.Remote interactions only work with web widget deployments, since the code runs in the user’s browser.
Use cases
| Use case | What the code does |
|---|---|
| Geolocation | Get the user’s latitude/longitude for location-aware responses |
| Form interaction | Pre-fill or submit forms on the page |
| UI updates | Show/hide elements, display notifications, or update content |
| Local storage | Read or write user preferences |
| Clipboard | Copy information to the user’s clipboard |
| Page data | Read product details, cart contents, or other page data |
Creating a remote interaction
Remote interactions are configured in the Export Widget settings under the Remote Interactions tab.Go to Remote Interactions tab
Click the Remote Interactions tab. You’ll see a list of any existing interactions and an Add Remote Interaction button.
Configure the interaction
Fill in the following fields:
- Method Name (required) - A unique identifier using snake_case (e.g.,
get_user_location). Max 64 characters, must start with a letter. - Display Name (optional) - A human-readable name shown to the AI (e.g., “Get User Location”).
- Function Description (required) - Explain what this function does so the AI knows when to call it. Minimum 10 characters.
- Arguments - Define input parameters the function accepts (see below).
- Returns (optional) - Describe what the function returns.
- Function Code (required) - The JavaScript code that runs in the browser.
- Custom Error Message (optional) - What to show if the function fails.
- Timeout - How long to wait for completion (1-30 seconds, default 10).
- Enabled - Toggle the interaction on or off.
Defining arguments
Each remote interaction can accept parameters from the AI agent. For each argument, define:| Field | Description |
|---|---|
| Name | Parameter name (alphanumeric and underscores) |
| Type | string, number, boolean, or object |
| Description | What this parameter is for |
| Required | Whether the AI must provide this parameter |
Writing function code
The function code runs in the user’s browser and has access to:data- The full RPC payload (includespayloadandresponseTimeout)params- The parsed arguments from the AI agent
JSON.stringify().
Example: Get user location
Example: Read page data
Example: Show a notification
Managing remote interactions
Viewing interactions
The Remote Interactions tab shows all defined methods with:- Method name (in monospace)
- Display name (if set)
- Description
- Argument tags showing name and type
- Enabled/disabled status
Editing
Click the edit icon on any interaction to modify its configuration.Enabling / Disabling
Use the toggle switch to enable or disable an interaction without deleting it. Disabled interactions are not available to the agent.Deleting
Click the delete icon and confirm to permanently remove an interaction.Validation rules
| Field | Rule |
|---|---|
| Method name | Max 64 chars, starts with letter, alphanumeric + underscores only |
| Function description | Min 10 characters, max 255 |
| Arguments | Each must have name, type, and description; names must be unique |
| Function code | Required, cannot be empty |
| Timeout | Between 1 and 30 seconds |
| Duplicate names | Cannot have two interactions with the same method name per agent |

