LiveKit audio & video rooms

Audio and video rooms for NIP-29 groups via a LiveKit server: token endpoints, JWT signing and the group metadata that advertises rooms.

Setup

  1. Set relay.livekit_url, relay.livekit_api_key and relay.livekit_api_secret in the config file.
  2. Add the livekit tag to a group's metadata via an admin's kind:9002 edit.
  3. Clients fetch a JWT from /.well-known/nip29/livekit/<group-id> with NIP-98 auth (a pubkey banned with NIP-86 banpubkey is refused).
  4. The relay publishes a kind:39004 participant list per livekit group, refreshed every relay.livekit_participants_interval_secs (default 15) and immediately when LiveKit sends webhooks to /.well-known/nip29/livekit/webhook — point the LiveKit server's webhook.urls at it and let webhook.api_key match relay.livekit_api_key (the relay verifies the signed payload; missed events are reconciled by the poll). Leaving the group's LiveKit mode clears the list.

Checking support

sh
curl -i http://127.0.0.1:8080/.well-known/nip29/livekit

204 means the room server is enabled.

Configuration

toml
[relay]
livekit_url = "wss://livekit.example.com"
livekit_api_key = "..."
livekit_api_secret = "..."
livekit_participants_interval_secs = 15
Tip
LiveKit settings are fixed at startup — changing them requires a restart.