Skip to main content

WHIP

WHIP publishes WebRTC media from an external source such as OBS, ffmpeg, or a browser into a room. whip.create builds a publish URL and token locally, with no network call. Your WebRTC client then uses them to complete the SDP exchange and start publishing.

// 1. Build the publish credential (local, no network call).
const ingress = client.whip.create(roomId, { name: "Studio Camera" });

// 2. POST your SDP offer to the WHIP URL and read back the SDP answer.
const answer = await fetch(ingress.url, {
method: "POST",
headers: { "Content-Type": "application/sdp", Authorization: ingress.token },
body: sdpOffer, // the SDP offer from your WebRTC client
}).then((res) => res.text());
// apply `answer` as the remote description to start publishing

// 3. Tear down when finished.
await client.whip.delete(ingress);

The SDP offer comes from your WebRTC client (OBS, ffmpeg, a browser RTCPeerConnection). POST it to url with Content-Type: application/sdp and Authorization: <token>, then apply the SDP answer from the response to start publishing.

Options: participantId, name, expiresIn (default 1h), useExistingPeer.

note

The token is API-scoped and sensitive. Keep the expiry short and avoid logging it.

The ingress object

Returned by whip.create (built locally, no network call).

FieldTypeDescription
urlstringWHIP endpoint. POST your SDP offer here.
tokenstringToken authorizing the publish. Sensitive and short-lived.
streamKeystringAlias for token (some tools call this the bearer token or stream key).
roomIdstringRoom being published into.
participantIdstringThe publisher's participant id.
displayNamestringDisplay name shown for the publisher.

Got a Question? Ask us on discord


Was this helpful?