Docs
Everything you need for the pilot: tokens, roles, rooms and the browser test.
Harbor Relay runs open-source LiveKit. Your clients use the official LiveKit SDKs (web, iOS, Android, Flutter, React Native…) and connect to our LiveKit server directly. Harbor Relay adds what a hosted service needs around it: projects, API keys, short-lived tokens bound to your project, a browser test stream and a session log.
Quickstart
- Open your project in the console (invite-only pilot), copy the Harbor Relay API URL and create an API key.
- Store both on your server as
HARBOR_RELAY_API_URLandHARBOR_RELAY_API_KEY. - Add a backend endpoint that requests a token (below), then connect from the browser with
livekit-client.
// server.mjs — runs in YOUR backend (Node 18+). Never ship the API key to a browser. import express from "express"; const app = express(); // Placeholders: both values come from your project page in the Harbor Relay console. const HARBOR_RELAY_API_URL = process.env.HARBOR_RELAY_API_URL; // e.g. https://<harbor-relay-host>/api/v1 const HARBOR_RELAY_API_KEY = process.env.HARBOR_RELAY_API_KEY; // hr_sk_… (shown once) app.get("/api/harbor-token", async (req, res) => { // Authenticate your own user first, then decide the room and role. const response = await fetch(`${HARBOR_RELAY_API_URL}/tokens`, { method: "POST", headers: { Authorization: `Bearer ${HARBOR_RELAY_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ room: "bridge", // project-local room name identity: "user-123", // your user's id role: "viewer", // "viewer" can only watch; "publisher" may send }), }); if (!response.ok) return res.status(502).json({ error: "token request failed" }); const { serverUrl, token, expiresAt } = await response.json(); res.json({ serverUrl, token, expiresAt }); }); app.listen(3001);
serverUrl is the WebSocket URL of the LiveKit server that hosts your project. token is a LiveKit access token signed by Harbor Relay. It is valid for 10 minutes by default (maximum 1 hour) and only for the one room and role you asked for — request a new one for every join.
API keys
Keys look like hr_sk_<id>_<secret>. The full key is shown once when you create it. Harbor Relay stores only a keyed hash (HMAC-SHA-256) and the public id, so a lost key cannot be recovered — create a new one and revoke the old one. A revoked key is rejected immediately (401 invalid_api_key).
Only project owners can create and revoke keys. Never put a key into browser or mobile app code.
Token API
POST /tokens
curl -X POST "$HARBOR_RELAY_API_URL/tokens" \
-H "Authorization: Bearer $HARBOR_RELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"room":"bridge","identity":"user-123","role":"viewer"}'| Field | Type | Notes |
|---|---|---|
room | string | Project-local room name, [A-Za-z0-9_-], 1–64 chars. |
identity | string | Your user id, unique per room. 1–128 chars. |
role | "viewer" | "publisher" | Default viewer. |
name | string? | Display name shown to other participants. |
ttl | number? | Seconds, clamped to 60–3600. Default 600. |
{
"token": "eyJhbGciOi…", // LiveKit access token (JWT)
"serverUrl": "wss://<livekit-host>",
"room": "hr_3f9c0a1b2d4e~bridge", // full LiveKit room name
"projectRoom": "bridge",
"identity": "user-123",
"role": "viewer",
"expiresAt": "2026-11-23T15:20:00.000Z"
}GET /rooms
Active rooms of your project (participants, publishers). Rooms of other projects are never listed.
GET /sessions
The last 50 recorded sessions of your project.
All endpoints use Authorization: Bearer <api key>. Errors: 400 invalid request, 401 invalid key, 429 rate limited, 503 service not configured.
Rate limits
Per API key and minute: 60 token requests and 60 reads (rooms, sessions). Responses carryX-RateLimit-Limit, X-RateLimit-Remaining andX-RateLimit-Reset; a 429 also has Retry-After. After 20 failed key checks from one IP within a minute, that IP gets 429 until the minute is over. Cache tokens until shortly before expiresAt instead of requesting one per page view.
Roles & permissions
| Role | Join & watch | Send camera / mic / screen | Data messages | Admin, record, list rooms |
|---|---|---|---|---|
| viewer | yes | no | no | no |
| publisher | yes | yes | yes | no |
The server decides the grants; the request can only choose between these two roles. A viewer token cannot publish, even with a modified client.
Rooms & isolation
Every project gets a server-assigned namespace such as hr_3f9c0a1b2d4e. When you ask for room bridge, the token is issued for hr_3f9c0a1b2d4e~bridge. The namespace comes from your API key, never from the request, so one project cannot obtain a token for another project’s room. Keys, rooms and sessions are scoped the same way.
Sessions
Harbor Relay receives signed webhooks from the LiveKit server and records, per room session: start, end, participant joins, peak participants and published tracks. Traffic and billable usage are not shown yet — they will be added once per-project metering has been verified.
Browser test stream
In the console, open a project and choose Open test area. One browser sends its camera (microphone optional); the viewer link opens a view-only player in a second browser or on a phone. The link expires after two hours.
Pilot status
- Recorded two-camera demo on this page — Available
- Developer console: projects, API keys, token API — Pilot · invite only
- Browser-to-browser test stream — Pilot · invite only
- Session log per project (from LiveKit webhooks) — Pilot · invite only
- Two simultaneous cameras in production — In testing
- Capacity for multiple customers — In testing
- Traffic and usage per project — After pilot
- Billing and public sign-up — After pilot