# Mixers Bind program inputs, save scenes and follow explicit activation operations. 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; 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](/reference/sdk/server/node/request-options). Input and result names are public imports from `@relayrtc/node`. | Method | Signature | | --- | --- | | `mixers.get` | `(mixerId: string, options?: RequestOptions): Promise` | | `mixers.listScenes` | `(mixerId: string, options?: RequestOptions): Promise<{ data: MixerSceneResource[]; }>` | | `mixers.putScene` | `(mixerId: string, sceneId: string, input: PutMixerSceneInput, options?: RequestOptions): Promise` | | `mixers.activateScene` | `(mixerId: string, input: ActivateMixerSceneInput, options?: RequestOptions): Promise` | | `mixers.addOverlay` | `(mixerId: string, input: CreateMixerOverlayInput, options?: RequestOptions): Promise` | | `mixers.removeOverlay` | `(mixerId: string, overlayId: string, options?: RequestOptions): Promise<{ id: string; deleted: true; }>` | | `mixers.stop` | `(mixerId: string, input: { version: number; }, options?: RequestOptions): Promise` | | `mixers.getOperation` | `(operationId: string, options?: RequestOptions): Promise` | | `broadcasts.mixers.create` | `(broadcastId: string, input?: CreateMixerInput, options?: RequestOptions): Promise` | | `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](/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/mixers) and the [public type index](/reference/sdk/server/node/types).