You are currently viewing the React version of this page. Use the dropdown to the right to customize this page for your client framework.
Connection-time configuration
Often you need to pass configuration to the server when starting the bot — a system prompt, preferred language, user preferences, or any other data the server needs before the pipeline runs. Pass it viarequestData in startBotAndConnect().
Sending messages to the server
UsesendClientMessage() to send a fire-and-forget message to the bot. The server handles it and is not expected to send a direct response.
on_client_message event handler or from inside a FrameProcessor:
Requesting data from the server
UsesendClientRequest() to send a message and wait for a response. Useful for querying server state or triggering an action that needs to confirm success or failure.
send_server_response() or push a RTVIServerResponseFrame:
Receiving messages from the server
The server can push unsolicited messages to the client at any time — for example, to notify the client that a setting has changed.Use
On the server, send messages via useRTVIClientEvent to subscribe to ServerMessage within a component:send_server_message() or by pushing a RTVIServerMessageFrame:
API reference
Client Methods
sendClientMessage, sendClientRequest, registerFunctionCallHandlerCallbacks & Events
onServerMessage, onMessageError, and related events