Guest stages
Bind application identities to invitations, decisions and scoped RTC grants.
On this page
These methods run on your backend and require a compatible API/SDK build; see installation.
Import and client
Set RELAYRTC_API_URL and RELAYRTC_SECRET_KEY in your backend environment. Keep the secret key on the server.
import { RelayServer } from '@relayrtc/node'
const relay = new RelayServer({
apiUrl: process.env.RELAYRTC_API_URL!,
apiKey: process.env.RELAYRTC_SECRET_KEY!,
})Authorization and inputs
Reads require streams:read; operator commands streams:write. Audience and RTC grant issuance also require streams:publish and tokens:create. AudienceGrantInput carries a backend-verified subject, name, role, explicit delegations and TTL. Never derive authority directly from an untrusted browser body.
Methods
All methods return promises. Their final argument is optional RequestOptions. Input and result names are public imports from @relayrtc/node.
| Method | Signature |
|---|---|
streams.guests.getStage | (streamId: string, broadcastId: string, options?: RequestOptions): Promise<GuestStage> |
streams.guests.configureStage | (streamId: string, broadcastId: string, input: GuestStageInput, options?: RequestOptions): Promise<GuestStage> |
streams.guests.createAudienceGrant | (streamId: string, broadcastId: string, input: AudienceGrantInput, options?: RequestOptions): Promise<{ token: string; expiresAt: string; audienceId: string; }> |
streams.guests.invite | (streamId: string, broadcastId: string, input: InviteGuestInput, options?: RequestOptions): Promise<GuestResource> |
streams.guests.requestJoin | (streamId: string, broadcastId: string, input: RequestGuestInput, options?: RequestOptions): Promise<GuestResource> |
streams.guests.listInvites | (streamId: string, broadcastId: string, query?: { cursor?: string; limit?: number; }, options?: RequestOptions): Promise<GuestRoster> |
streams.guests.listRequests | (streamId: string, broadcastId: string, query?: { cursor?: string; limit?: number; }, options?: RequestOptions): Promise<GuestRoster> |
streams.guests.list | (streamId: string, broadcastId: string, query?: { cursor?: string; limit?: number; }, options?: RequestOptions): Promise<GuestRoster> |
streams.guests.getStatus | (streamId: string, broadcastId: string, query: { subject: string; cursor?: string; limit?: number; }, options?: RequestOptions): Promise<GuestRoster> |
streams.guests.acceptInvite | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestResource> |
streams.guests.declineInvite | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestResource> |
streams.guests.cancelInvite | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestResource> |
streams.guests.approveRequest | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestResource> |
streams.guests.rejectRequest | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestResource> |
streams.guests.leave | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestResource> |
streams.guests.remove | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestResource> |
streams.guests.mute | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision & { audio?: boolean; video?: boolean; }, options?: RequestOptions): Promise<GuestResource> |
streams.guests.createJoinGrant | (streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise<GuestJoinGrant> |
Behavior and results
Stage settings and decisions use current versions. Management own actions must supply the authenticated subject; audience credentials bind their own subject. InviteGuestInput grants explicit audio/video/screen permissions. Acceptance reserves a seat but does not start devices. Server mute changes permissions and requires deliberate RTC rejoin; local mute is separate. Guest lists use limit 1–50 (default 25), cursor and caller-filtered roster metadata.
Requests and errors
Streaming commands generate an idempotency key when omitted. Use an explicit stable key when retrying an uncertain application command; reuse its payload and target. Mutations do not retry automatically. Read retries and cancellation follow RequestOptions. A canceled HTTP request does not undo committed server work.
Failures throw RelayApiError. Reload resources after version conflicts; inspect asynchronous operation/processing states before reporting completion.
See REST parameters, defaults and errors and the public type index.