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.
- Node.js
- Go
// 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);
// 1. Build the publish credential (local, no network call).
ingress, err := client.WHIP.Create(roomID, videosdk.CreateWhipParams{Name: "Studio Camera"})
// 2. POST your SDP offer to the WHIP URL and read back the SDP answer.
req, _ := http.NewRequest("POST", ingress.URL, strings.NewReader(sdpOffer))
req.Header.Set("Content-Type", "application/sdp")
req.Header.Set("Authorization", ingress.Token)
resp, _ := http.DefaultClient.Do(req)
answer, _ := io.ReadAll(resp.Body) // SDP answer, apply it to start publishing
// 3. Tear down when finished.
client.WHIP.Delete(ctx, *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).
| Field | Type | Description |
|---|---|---|
url | string | WHIP endpoint. POST your SDP offer here. |
token | string | Token authorizing the publish. Sensitive and short-lived. |
streamKey | string | Alias for token (some tools call this the bearer token or stream key). |
roomId | string | Room being published into. |
participantId | string | The publisher's participant id. |
displayName | string | Display name shown for the publisher. |
Got a Question? Ask us on discord

