Client libraries
In the browser, a Voqalize session runs on your client and
@voqalize/client-transport, which handles the microphone, camera, screen share
and the agent’s audio. Your server installs neither: the Python SDK depends on
none of it.
Install
Section titled “Install”pnpm add @pipecat-ai/client-js @pipecat-ai/small-webrtc-transport @voqalize/client-transport@0.4.1import { PipecatClient } from "@pipecat-ai/client-js";import { createVoqalizeTransport } from "@voqalize/client-transport";
const client = new PipecatClient({ transport: createVoqalizeTransport(), enableMic: true,});client.connect(params) takes the body sessions.connect returns.
Connect your app has that request and the one line of glue
around it.
What @voqalize/client-transport does
Section titled “What @voqalize/client-transport does”It connects your client to the session over WebRTC and handles the media itself. It is MIT and public.
- Loads nothing from a third party. It uses
navigator.mediaDevicesonly, and no script is fetched from another origin into your page. - Recovers a session that goes quiet: a microphone lost on reconnect, a device unplugged mid-sentence, blocked autoplay, an Android element that stops playing. The package’s FINDINGS records each measurement.
- Keeps a session across a page load with
keepAcrossPageLoads: true. Connect your app has the code.
createVoqalizeTransport(options?) takes the SmallWebRTCTransport options plus
these of its own:
| Option | Default | What it does |
|---|---|---|
mediaManager | A new VoqalizeMediaManager | Pass your own instance when your app needs a reference to it, for example to bind an audio element before the transport exists. |
keepAcrossPageLoads | false | Remember this tab’s session so connect() with no arguments rejoins it after a reload. Adds the read-only transport.hasLiveCall. |
The client
Section titled “The client”What a Voqalize page calls on the client:
client.connect(params)starts the session with the bodysessions.connectreturned. It resolves whenRTVIEvent.BotReadyfires, and from then on the client can send.client.disconnectBot()ends the session at once, andclient.disconnect()closes the connection.sendUIEvent(name, payload)sends the brain an app event. It throws beforeRTVIEvent.BotReady, so send from a handler that runs afterconnectresolves.client.sendText(…)sends a typed message. Voqalize commits it as a user turn, so your brain answers it inon_user_message.client.on(RTVIEvent.UICommand, …)receives the brain’s actions as{ command, payload }.
In React, from @pipecat-ai/client-react:
useUICommandHandlerreceives one action by name.usePipecatConversationgives the transcript.
@pipecat-ai/client-react and @pipecat-ai/voice-ui-kit are optional.
RTVI messages lists which message types cross to your brain.
The avatar is @voqalize/avatar, which takes the client you
already have and renders from the same session’s messages.
Mobile apps
Section titled “Mobile apps”Voqalize is pipecat-compatible. A native app (React Native, iOS or Android) uses pipecat’s own client SDKs, each with a SmallWebRTC transport. Our runnable examples are web only; start from pipecat’s client SDK documentation.
- Start sessions from your backend with an
sk_key. A native app sends noOriginheader, so apk_key is refused with403 origin_not_allowed. Your app asks your backend, your backend callssessions.connect, and the app hands the response to its pipecat client, as Connect your app shows. @voqalize/client-transportandkeepAcrossPageLoadsare web only.
Versions
Section titled “Versions”| Package | Version |
|---|---|
@voqalize/client-transport | 0.4.1, pinned exactly (CHANGELOG) |
@pipecat-ai/client-js | >=1.13.0 <2 (peer of our transport) |
@pipecat-ai/small-webrtc-transport | >=1.10.7 <2 (peer of our transport) |
voqalize-agent-sdk (your server) | ==0.15.0; installs websockets, protobuf, pydantic, a JWT library and loguru |
Read next
Section titled “Read next”- Connect your app: the request, both keys, and the one line you write.
- RTVI messages: what crosses between page and brain.