webrtc-livekit
Context: $ARGUMENTS
LiveKit is an Apache-2.0 WebRTC SFU written in Go — a single-binary deployment with a vast SDK matrix. Docs home: https://docs.livekit.io/home/. Repo: https://github.com/livekit/livekit.
Quick start
- Install server binary for your platform: → Step 1 (
livekit.py install-server) - Install the CLI (
lk/livekit-cli): → Step 1 (livekit.py install-cli) - Start a dev server: → Step 2 (
livekit.py start) - Mint a JWT access token: → Step 3 (
livekit.py mint-token) - Record or stream-out a room: → Step 5 (
livekit.py egress-start) - Ingest RTMP/WHIP/SRT into a room: → Step 6 (
livekit.py ingress-start)
Data model
Room (per-meeting)
├── Participant (per-user)
│ ├── TrackPublication (the publisher's declaration)
│ │ └── Track (camera / mic / screen-share / data)
│ └── Permissions (from JWT grants)
└── Metadata (free-form, room-wide or per-participant)
Tokens are JWT (HS256). Each token carries a video grant describing which room and which permissions.
Step 1 — Install the binaries
# Server
uv run ${CLAUDE_SKILL_DIR}/scripts/livekit.py install-server --dest ~/bin
# CLI ("lk", formerly "livekit-cli")
uv run ${CLAUDE_SKILL_DIR}/scripts/livekit.py install-cli --dest ~/bin
The script downloads the correct release from github.com/livekit/livekit/releases (server) and github.com/livekit/livekit-cli/releases (CLI) for your uname -sm, extracts it, and places the binary in --dest. No sudo required if --dest is writable. Homebrew and the official install.sh exist upstream — pick whichever fits your OS.
Step 2 — Start a dev server
uv run ${CLAUDE_SKILL_DIR}/scripts/livekit.py start --dev
--dev launches with a built-in dev API key / secret (devkey / secret) and enabled self-signed TURN on 443. For production, write a YAML config:
# livekit.yaml (abridged — see references/deployment.md for the full set)
port: 7880
bind_addresses: ['']
rtc:
port_range_start: 50000
port_range_end: 60000
tcp_port: 7881
use_external_ip: true
keys:
devkey: secret
redis:
address: redis:6379
Run: livekit-server --config livekit.yaml.
Step 3 — Mint access tokens (JWT HS256, pure Python)
LiveKit tokens are JWTs with an iss = API key, sub = participant identity, video grant, and standard iat / exp. The helper mints them with stdlib only (hmac + hashlib + base64 + json):
uv run ${CLAUDE_SKILL_DIR}/scripts/livekit.py mint-token \
--api-key devkey --api-secret secret \
--room my-room --identity alice \
--name 'Alice' --ttl 3600 \
--grants roomJoin=true,canPublish=true,canSubscribe=true,canPublishData=true