oxDocs
Browse documentation
Introduction
Vision API
Inference API
Realtime
Integrations

Video

LiveKit
LiveKit & SIP
Administration
Reference

Video

LiveKit

Publish a browser camera, mint viewer access, and refresh LiveKit tokens safely.

Publish a browser camera

Create a managed stream on your server and return only its publish descriptor to the signed-in browser. The browser joins the room and publishes video with the official LiveKit client. Never send the Hallikar API key to browser code.

TypeScript

import { Room, createLocalTracks } from "livekit-client";

const room = new Room();
await room.connect(stream.publish.url, stream.publish.token);
const [videoTrack] = await createLocalTracks({ video: true, audio: false });
await room.localParticipant.publishTrack(videoTrack);

Watch what Hallikar receives

Call POST /streams/{id}/viewer-token on your server and return the short-lived view descriptor to an authorized viewer. Viewer tokens cannot publish media or data. This endpoint returns 409 for livekit_room sources because the customer-owned room controls its own subscribers.

Refresh without interrupting capture

Call keepalive before the lease expires. For a managed stream, pass the replacement publish token to LiveKit with room.updateToken(newToken). For a customer-owned LiveKit source, send a refreshed join token in {"source_token":"..."}; pull sources do not use either token.

Help improve this guideFound something unclear or incomplete?
Report an issue ↗View source ↗