@komaa/cartesia-msteams-bridge
brings a Cartesia Line agent onto a Microsoft Teams call. It is the Cartesia analogue of the
ElevenLabs, LiveKit,
OpenAI and Deepgram bridges: it hosts the HMAC
WebSocket that StandIn connects to, then relays audio to and from a Line agent stream (Cartesia’s
WebSocket API, the integration they
provide for bringing your own telephony).
Where the brain lives. A Line agent is your code deployed on Cartesia’s platform - LLM,
tools, conversation logic, hangup. This bridge is deliberately a hardened transport: unlike the
other bridges there is no in-process tool registry or vision hook, because the Line wire has no
client-side tool channel. Your agent still receives the full Teams context (caller identity,
participants, active speaker, DTMF, recording state) as metadata and custom events - the
contract is documented.
Prefer Python? The same bridge exists as a Python package:
cartesia-msteams-bridge on PyPI
(pip install cartesia-msteams-bridge), with its own
docs site and
repo. Same wire protocol, same
environment variables, same hardening - pick the runtime that fits your stack. This page follows
the Node package.How it works
The bridge mints a short-lived, agent-scoped access token per call (the API key never rides an agent socket), openswss://api.cartesia.ai/agents/stream/{agentId}, sends the start event, and
relays once the server acks. Audio is verbatim: the StandIn wire is base64 PCM 16 kHz and the
Line stream is pinned to pcm_16000 with base64 payloads both ways, so the hot path relays the
payload string untouched - no decode, no re-encode, no transcoding. Line’s clear (barge-in) maps
to a Teams-side playback flush, and keypad digits ride the wire as native dtmf events.
Requirements
- Node.js
>= 20. - A Cartesia API key and a deployed Line agent (its agent id) - docs.cartesia.ai/line.
- A StandIn subscription (standin.komaa.com, free package works) - the hosted media bridge that joins the Teams call and connects to this service. See Architecture.
- Your own Microsoft Teams bot connected to StandIn - the Teams setup walks through the Azure bot, the app package, and the upload. To try it without one, use the sandbox.
Run
Env-configured, no install step needed:npm i @komaa/cartesia-msteams-bridge) and embed it - see the
library API for the programmatic
surface, including the graceful drain() for embedders.
The bridge binds its media WebSocket (default ws://<host>:8080/voice/msteams/stream; StandIn
appends /{callId} per call).
Expose the WebSocket (Agent voice URL)
StandIn connects to the bridge from the internet, so the port must be reachable - a public host or a tunnel. With Tailscale Funnel:Connect it to StandIn
Register that URL (with a matching shared secret) on your identity in the dashboard, or use the sandbox to try it without your own Teams bot:- Set the identity’s Agent voice URL to where the bridge listens.
- Set
WORKER_SHARED_SECRETto the shared secret from pairing - both sides must match exactly, or the WebSocket handshake is rejected with401. - Place a Teams call (or join the sandbox meeting). StandIn joins, connects to the bridge, and your Line agent answers.
Try the runnable example
The fastest way to understand the bridge is to run its example project - a minimal, working embedding you can copy straight into your own repo.Run the example, step by step
Clone
examples/basic-bridge, fill in three environment variables, expose the port, connect it to
StandIn, and place a call - about 20 lines of code, because the agent’s brain lives in your Line
deployment.Next: the full configuration reference - every environment variable,
the call governor, and the Sonic TTS goodbye. Deep protocol and library docs live on the
project site, including
what your Line agent receives.