batondocs← SiteSign in
Integrations/LiveKit

LiveKit

Point LiveKit's TURN configuration at Baton, or pass iceServers from the client at connect time.

Server config (livekit.yaml)

livekit.yaml
rtc:
  turn_servers:
    - host: relay.usebaton.io
      port: 443
      protocol: tls            # turns: on 443 — best firewall traversal
      username: "1718200000:project_ab12"
      credential: "<ephemeral-credential>"

Client config

client.ts
const { iceServers } = await fetch("/api/ice").then(r => r.json());
await room.connect(url, token, { rtcConfig: { iceServers } });
Most common LiveKit mistake

If only host candidates appear, check rtc.use_external_ip and the node's advertised IP. A LiveKit SFU behind NAT that advertises an internal address will never surface relay candidates — see Troubleshooting.