@node-webrtc-rust

node-webrtc-rust is the open-source WebRTC + speech stack that VoiceThere cloud runners embed. Current npm cut of the TypeScript packages: 0.9.10. License: MIT.

You do not add this next to a VoiceThere agent to use STT/TTS on VoiceThere cloud — the runner already has it. Install it when you run a local worker, write a custom signaling server, or use the Node test runtime in @voicethere/client/node.

When to install it yourself

SituationInstall
VoiceThere cloud agent@voicethere/agent only. Speech event types are re-exported from there.
Browser / embed against VoiceThere cloud@voicethere/client. Signaling is a dependency; you do not import the native SDK in the browser.
Local live-test / custom Node voice worker@node-webrtc-rust/sdk (+ helpers / signaling as needed)
Headless client testsOptional peer @node-webrtc-rust/sdk with @voicethere/client/node

Packages

PackageRole
@node-webrtc-rust/sdkBrowser-compatible RTCPeerConnection, VoiceAgent (/voice), conference rooms.
@node-webrtc-rust/signalingWebSocket signaling server, client, auto-negotiate. Used by @voicethere/client.
@node-webrtc-rust/helpersSessionPod, VoiceAgentSessionHost, PCM kick-frame helpers — the multi-session server pattern.
@node-webrtc-rust/bindingsNative NAPI addon. Platform packages (bindings-darwin-arm64, Linux gnu/musl, Windows, …) ship with releases. You install sdk; npm pulls the right binary.

Voice pipeline

One VoiceAgent binds to one WebRTC conversation (one inbound + one outbound track). Rust owns PCM cadence, VAD, barge-in flush, STT/TTS vendor I/O. Node owns LLM calls, tools, and session config. user_speech_final is the usual turn boundary; sendTextToTTS() is the parent-side speak. VoiceThere agents call speak() instead — the runner forwards that into this pipeline.

Default on-worker STT/TTS is Sherpa. Optional cloud vendors (OpenAI, Deepgram, ElevenLabs, …) are configured on the project. STT & TTS vendors, advanced voice settings.

npm install @node-webrtc-rust/sdk

Library README (architecture, vendor env, examples): github.com/akirilyuk/node-webrtc-rust.

Signaling

Cloud sessions mint a join token and signaling URL from the sessions API; the browser client already speaks this protocol. For a local runner, point connectVoiceSession at ws://127.0.0.1:8080/ws. Peer ids that reach a VoiceThere runner must start with client- — see @voicethere/client.

Supported platforms

Prebuilt native binaries for:

  • macOS Apple Silicon and Intel
  • Linux x64 gnu, x64 musl (Alpine), arm64 gnu
  • Windows x64 MSVC

Node.js ≥ 18 for the library; VoiceThere cloud agents still follow the agent package (Node 22+ / runner Node 26 permission model).

← All documentation