RelayrtcDocs
Get started
Documentation
Node SDK

Mixers

Bind program inputs, save scenes and follow explicit activation operations.

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.

TypeScript
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; authoring/stop require streams:write; creation and activation also require streams:publish. CreateMixerInput binds up to three additional streams; primary is implicit. putScene requires the saved scene version (zero for creation). activateScene requires mixer version, sceneId and sceneVersion.

Methods

All methods return promises. Their final argument is optional RequestOptions. Input and result names are public imports from @relayrtc/node.

MethodSignature
mixers.get(mixerId: string, options?: RequestOptions): Promise<MixerResource>
mixers.listScenes(mixerId: string, options?: RequestOptions): Promise<{ data: MixerSceneResource[]; }>
mixers.putScene(mixerId: string, sceneId: string, input: PutMixerSceneInput, options?: RequestOptions): Promise<MixerSceneResource>
mixers.activateScene(mixerId: string, input: ActivateMixerSceneInput, options?: RequestOptions): Promise<MixerCommandResult>
mixers.addOverlay(mixerId: string, input: CreateMixerOverlayInput, options?: RequestOptions): Promise<MixerOverlay>
mixers.removeOverlay(mixerId: string, overlayId: string, options?: RequestOptions): Promise<{ id: string; deleted: true; }>
mixers.stop(mixerId: string, input: { version: number; }, options?: RequestOptions): Promise<MixerCommandResult>
mixers.getOperation(operationId: string, options?: RequestOptions): Promise<MixerOperation>
broadcasts.mixers.create(broadcastId: string, input?: CreateMixerInput, options?: RequestOptions): Promise<MixerResource>
broadcasts.mixers.list(broadcastId: string, options?: RequestOptions): Promise<{ data: MixerResource[]; }>

Behavior and results

Saving a draft does not put it on air. MixerCommandResult contains mixer and operation; poll getOperation and inspect desiredVersion/appliedVersion to confirm activation. Scene/mixer versions and program revisions are distinct. addOverlay accepts name, contentType: image/png and dataBase64. Stop returns to the original source without implicitly ending the room or broadcast.

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.