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() in a few lines, with a custom vision hook (your own model answers the agent’s look tool - the raw frame never leaves your process). Env-file config and graceful shutdown are built in.

What you need first

  • Node.js >= 20.
  • An ElevenLabs agent (Agents dashboard) with audio input and output format set to PCM 16000 Hz, plus an API key.
  • A StandIn identity with its shared secret (from pairing or the dashboard). The sandbox works too if you have no Teams bot yet.

Create the ElevenLabs agent

The bridge relays audio verbatim at 16 kHz, so the one thing that must be right on the ElevenLabs side is the agent’s audio format. Create an agent in the Agents dashboard, then set:
The dashboard has more than one “output format” control - the widget / embed format is not the same as the conversation format the bridge actually uses (tts.agent_output_audio_format). If a call is garbled even though the UI looks like 16 kHz, the conversation format is still wrong. Set it explicitly and re-check with the snippet below.
Then grab two values for your .env in the next steps:
  • Agent ID (agent_...) from the agent’s page, for ELEVENLABS_AGENT_ID.
  • API key from dashboard -> API keys, for ELEVENLABS_API_KEY.
Check the format the bridge will actually get, regardless of what the UI shows:
If that is not pcm_16000, set it directly:

1. Clone and install

2. Configure the environment

Open .env and fill in the three required values: The example still boots with dummy values, so you can check the wiring before the credentials are real. Everything else (PORT, MAX_CALL_MINUTES, goodbye behavior, regional hosts) has sensible defaults - see the configuration reference.

3. Start it

It listens on port 9442 and takes the last path segment of the upgrade URL as the callId, so register it under the standard calling path:
The example still prints a legacy …/voice/msteams/stream line on startup. Ignore it - the bridge anchors on nothing and answers on any base path, and /msteams/calling is the path StandIn and every other runtime use.
There is no chat lane here - just this WebSocket, plus /healthz and /metrics at the root.

4. Expose the calling path

StandIn connects from the internet, so the endpoint needs a public wss:// URL. Any tunnel works:
See Expose your agent, the LiveKit / ElevenLabs tab: one mount for /msteams/calling on port 9442, and no /api/messages because this bridge is voice only.Your URL, with no port: wss://<machine>.<tailnet>.ts.net/msteams/calling
Verify locally with curl http://127.0.0.1:9442/healthz (returns ok). A plain GET to /msteams/calling answers 404 even on a healthy bridge - only a WebSocket upgrade is routed - and through a Funnel you must add --http1.1, or curl’s upgrade headers are ignored over HTTP/2 and you get the same misleading 404.

5. Connect it to StandIn and call

  1. In your StandIn dashboard, set the identity’s Agent calling URL to the wss:// URL from step 4. Leave the Agent messages URL empty.
  2. Make sure the identity’s shared secret equals BRIDGE_SECRET.
  3. Place a Teams call to your bot (or join the sandbox meeting). StandIn joins, connects to the bridge, and your ElevenLabs agent answers.

The vision hook

The example ships a custom VisionDescriber stub in index.mjs. When your agent calls its look client tool, the bridge hands your function the current camera or screen-share frame and returns your text description to the agent - the raw frame never leaves your process. Replace the stub with a call to any vision-capable model. If you prefer configuration over code, the VISION_API_URL / VISION_API_KEY / VISION_MODEL variables do the same against any OpenAI-compatible endpoint - see Vision.

From example to your own project

Depend on the published package instead of the local checkout:
Then copy the example’s index.mjs as your starting point. The library API documents the programmatic surface (config, server handle, hooks).

If something does not work

  • WebSocket rejected with 401 - BRIDGE_SECRET does not match the secret in StandIn, or the tunnel stripped the path so the callId the bridge signed against is not the one StandIn sent.
  • Bot joins the call but stays silent - the Agent calling URL is unreachable from the internet or points at the wrong port; re-check the tunnel. Probing it with curl needs --http1.1, and a plain GET returns 404 even when the mount is fine.
  • Agent audio garbled or missing - the ElevenLabs agent’s audio input/output format is not PCM 16000 Hz.
  • More: Troubleshooting.

Example README

Configuration

Library API