Skip to main content
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. Budget about 10 minutes once the Teams setup is done.

examples/basic-bridge

loadConfig() + startServer() and nothing else - about 20 lines, because the agent’s brain (LLM, tools, conversation logic) lives in your Line deployment on Cartesia, not in the bridge. Env-file config and graceful shutdown are built in.

What you need first

  • Node.js >= 20.
  • A Cartesia API key and a deployed Line agent (its agent id) - docs.cartesia.ai/line.
  • A StandIn identity with its shared secret (from pairing or the dashboard). The sandbox works too if you have no Teams bot yet.

1. Clone and install

2. Configure

Fill in the three required values: Optionally give the call a deterministic opening line (a natural spoken AI disclosure):

3. Run and expose

The bridge listens on port 9442. Expose it with a tunnel (Tailscale Funnel, Cloudflare Tunnel, ngrok, dev tunnels - see the installation page) and note the public wss://…/voice/msteams/stream URL.

4. Connect to StandIn and call

Set your identity’s Agent calling URL to that wss:// URL in the dashboard (or use the sandbox), then place a Teams call. In the logs you should see:
Speak, and your Line agent answers in its own voice.

Where the interesting parts live

There is no vision hook or custom tool to study here - those belong in your Line agent code on Cartesia’s platform. What the bridge forwards to it (caller metadata, call_context and goodbye_request custom events, native DTMF) is documented on the project site:

Your Line Agent - the contract

The start metadata and custom-event shapes your agent code receives, how to detect a Teams call (metadata.from == "msteams"), and the transfer_call limitation.
Before production: set the governor variables (MAX_CALL_MINUTES, CARTESIA_TTS_MODEL + CARTESIA_TTS_VOICE_ID, GOODBYE_TEXT) so time limits end with a spoken goodbye instead of silence.