Messages
Complete reference for all protocol messages.
Worker messages
| Type | Description |
|---|---|
worker.hello | Initial handshake from worker |
worker.command | Send a browser command to the client |
worker.yield_to_user | Hand control to the user with conditions |
worker.complete | Mark session as successfully completed |
worker.fail | Mark session as failed with an error |
Client messages
| Type | Description |
|---|---|
client.hello | Initial handshake from client |
client.command_response | Result of executing a command |
client.events | Batch of telemetry events |
client.console_activity | Console log entries from the webview |
client.network_activity | Network activity records from the webview |
client.sdk_log | Internal SDK log entries |
Server messages (to client)
| Type | Description |
|---|---|
server.hello | Handshake response with session state |
server.command | Relayed command for the client to execute |
server.set_interactive | Toggle webview visibility for the user |
server.session_end | Session has reached a terminal state |
server.ack | Acknowledge received client events |
server.replay | Replay buffered messages after reconnection |
Server messages (to worker)
| Type | Description |
|---|---|
server.hello | Handshake response with session state |
server.client_ready | Client has connected to the session |
server.client_disconnected | Client has disconnected |
server.command_result | Relayed command result from the client |
server.error | Protocol error |
server.replay | Replay buffered messages after reconnection |
server.hello (to client)
The server.hello sent to the client includes optional configuration:
| Field | Type | Description |
|---|---|---|
eventFilter | EventFilterConfig? | Which event types the server wants |
debug | boolean? | Whether debug mode is enabled |
capture | CaptureConfig? | Page snapshot/screenshot capture settings |
injectionScripts | InjectionScript[]? | JavaScript to inject at document start |
Injection scripts
The server can deliver JavaScript injection scripts via server.hello. The client SDK injects these into the webview at document start. Built-in scripts include telemetry, network interception, console interception, and user interaction capture.
interface InjectionScript {
name: string; // e.g. "telemetry", "network", "console", "interaction"
source: string; // JavaScript source to inject
}Message format
All messages are JSON objects with a type field:
{
"type": "worker.command",
"command": {
"action": "navigate",
"url": "https://example.com"
}
}Next steps
Last updated on