Skip to main content

Ingress

Bring external media into a room three ways:

  • WHIP: publish WebRTC media in (OBS, ffmpeg, a browser).
  • WHEP: pull WebRTC media out.
  • Socket: stream raw media or data frames over a WebSocket.

WHIP

whip.create builds a publish URL and token locally, with no network call. POST your SDP offer to the URL with Authorization: <token>; the server returns the SDP answer.

const ingress = client.whip.create(roomId, { name: "Studio Camera" });
ingress.url;
ingress.token;

await client.whip.delete(ingress);

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

note

The token is API-scoped and sensitive. Keep the expiry short and don't log it.

WHEP

Same local-builder pattern, for pulling media out. Requires an active session in the room.

const play = client.whep.create(roomId, { source: { participantId: "presenter" } });

await client.whep.delete(play);

Options: participantId, source (which remote peer to pull), expiresIn.

Socket ingest

socketIngress.create returns a single-use WebSocket URL, valid for about 90 seconds. Connect to it and stream frames in. To tear down, close the socket.

const socket = await client.socketIngress.create(roomId, { participantId: "telephony-leg" });
socket.wsUrl;
socket.expiresIn;

Options: participantId, name, metadata, agent, region.

Got a Question? Ask us on discord


Was this helpful?