API
What you can call today
Authenticate with a Clerk session from the dashboard or with Authorization: Bearer pk_live_… from your server. Browsers receive short-lived participant tokens, not API keys.
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/sessions | Create a session. Requires authentication. |
| GET | /v1/sessions/:id | Read a session in your organization. |
| POST | /v1/sessions/:id/end | End it and disconnect participants. |
| POST | /v1/sessions/:id/invitations | Create or reuse the publisher or viewer invitation. |
| POST | /v1/invitations/redeem | Exchange an invitation for a participant token. |
| POST | /v1/participants/refresh | Refresh a participant token while the session is active. |
| POST | /v1/projects/:id/api-keys | Create an API key. The secret is returned once. |
| POST | /v1/api-keys/:id/revoke | Revoke a key. |
| POST | /v1/projects/:id/webhooks | Register an HTTPS endpoint. Deliveries are signed and retried. |
Viewer SDK
import { PeerKitSession } from "@peerkit/sdk";
const session = new PeerKitSession({
signalingUrl,
token: participantToken,
tokenExpiresAt,
refreshToken,
});
session.attachVideo(video);
await session.connect();
session.disconnect();The hosted camera page is for the phone. Customer applications embed the viewer and keep their API key on a server. See examples/server-integration.