# Guest stages Bind application identities to invitations, decisions and scoped RTC grants. These methods run on your backend and require a compatible API/SDK build; see [installation](/installation). ## Import and client Set `RELAYRTC_API_URL` and `RELAYRTC_SECRET_KEY` in your backend environment. Keep the secret key on the server. ```ts 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](/reference/sdk/server/node/request-options). Input and result names are public imports from `@relayrtc/node`. | Method | Signature | | --- | --- | | `streams.guests.getStage` | `(streamId: string, broadcastId: string, options?: RequestOptions): Promise` | | `streams.guests.configureStage` | `(streamId: string, broadcastId: string, input: GuestStageInput, options?: RequestOptions): Promise` | | `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` | | `streams.guests.requestJoin` | `(streamId: string, broadcastId: string, input: RequestGuestInput, options?: RequestOptions): Promise` | | `streams.guests.listInvites` | `(streamId: string, broadcastId: string, query?: { cursor?: string; limit?: number; }, options?: RequestOptions): Promise` | | `streams.guests.listRequests` | `(streamId: string, broadcastId: string, query?: { cursor?: string; limit?: number; }, options?: RequestOptions): Promise` | | `streams.guests.list` | `(streamId: string, broadcastId: string, query?: { cursor?: string; limit?: number; }, options?: RequestOptions): Promise` | | `streams.guests.getStatus` | `(streamId: string, broadcastId: string, query: { subject: string; cursor?: string; limit?: number; }, options?: RequestOptions): Promise` | | `streams.guests.acceptInvite` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | | `streams.guests.declineInvite` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | | `streams.guests.cancelInvite` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | | `streams.guests.approveRequest` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | | `streams.guests.rejectRequest` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | | `streams.guests.leave` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | | `streams.guests.remove` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | | `streams.guests.mute` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision & { audio?: boolean; video?: boolean; }, options?: RequestOptions): Promise` | | `streams.guests.createJoinGrant` | `(streamId: string, broadcastId: string, guestId: string, input: GuestDecision, options?: RequestOptions): Promise` | ## 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](/reference/sdk/server/node/request-options). A canceled HTTP request does not undo committed server work. Failures throw [RelayApiError](/reference/sdk/server/node/RelayApiError). Reload resources after version conflicts; inspect asynchronous operation/processing states before reporting completion. See [REST parameters, defaults and errors](/reference/api/v1/guests) and the [public type index](/reference/sdk/server/node/types).