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.

MethodPathPurpose
POST/v1/sessionsCreate a session. Requires authentication.
GET/v1/sessions/:idRead a session in your organization.
POST/v1/sessions/:id/endEnd it and disconnect participants.
POST/v1/sessions/:id/invitationsCreate or reuse the publisher or viewer invitation.
POST/v1/invitations/redeemExchange an invitation for a participant token.
POST/v1/participants/refreshRefresh a participant token while the session is active.
POST/v1/projects/:id/api-keysCreate an API key. The secret is returned once.
POST/v1/api-keys/:id/revokeRevoke a key.
POST/v1/projects/:id/webhooksRegister 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.