Available Callbacks
| Callback | Fires when |
|---|---|
onMessage | A new message (user or assistant) is added |
onMessageUpdate | A message is updated (e.g. during streaming) |
onToolCall | A tool starts, completes, or a client tool is invoked |
onWorkflow | A workflow starts, progresses, or ends |
onVerificationStatus | Identity verification status changes |
onError | An error occurs |
React SDK
Pass callbacks via theclient.on() method:
Callback Reference
onMessage
onMessageUpdate
onToolCall
event.type | Description |
|---|---|
tool_call_start | Server-side tool invocation began |
tool_call_complete | Server-side tool finished (event.success) |
client_tool_call | Client-side tool was invoked in the browser |
onWorkflow
event.type | Description |
|---|---|
workflow_started | Workflow began (event.name, event.todos) |
workflow_todo_updated | A step completed (event.todoId, event.status) |
workflow_ended | Workflow finished |
workflow_complete_prompt | Workflow requests user confirmation |
