Skip to main content

FileRef

A reference to an uploaded file, returned by uploadFile(). Pass into sendCommand() to attach files to a command.
Definition
See File Uploads for usage examples.

isFileRef()

Structural check for anything shaped like a FileRef — useful for callers who’d rather duck-type than rely on instanceof (for example, if two copies of the package end up bundled into the same page).
Signature

MessageScope

Definition
Third argument to sendCommand(). Kept for compatibility — see that method for what "runtime" actually does.

ReactorStatus

The connection state of a Reactor instance.
Definition

ReactorState

The reactive state kept by the useReactor() store. Not a return type on Reactor itself — the base class exposes the same information through individual getters (getStatus(), getLastError(), getSessionId()).
Definition
See React Hooks for the full store, including actions.

ConnectOptions

Options passed to connect(), reconnect(), and the React provider’s connectOptions prop.
Definition
  • maxAttempts caps how many times the SDK polls the server for its SDP answer (its reply in the WebRTC connection handshake) before the connect fails.
  • autoResumeTracks (default true) subscribes to every output (recvonly) track as soon as the connection is established, so output reaches your client on connect. The model emits frames the whole time the session runs; this only controls whether your client receives them. Set it to false to start unsubscribed and subscribe per track with resumeTrack().
  • sessionId attaches to a session that already exists, for example one created by your backend, instead of creating a new one. The token passed to connect() must be valid for the account that owns the session. Only the session’s creator can terminate it. A client that adopts the session leaves it running when it disconnects. See Sessions.
  • connectionId joins the session using a specific WebRTC connection id already registered for it, for example one your backend created and handed to this client. When omitted, the SDK registers a fresh connection and the server mints the id. connect() rejects if the id is unknown or already closed.

ReactorError

The one class for both the error event payload and what a rejected/thrown call carries — ReactorError is the base of a typed hierarchy keyed by code, so instanceof UnauthorizedError and code === 'UNAUTHORIZED' are equivalent, one just typed. Codes are open-ended (the platform can send its own), so an unrecognized one falls back to the base class itself rather than throwing.
Definition
string
required
A stable code — see Error codes below, or a code the platform sent for a request it rejected that this package doesn’t have a class for.
boolean
Whether the same call could succeed later.
number
The HTTP status, when the failure came from one.
string
Which call failed, e.g. "connect", "sendCommand".
number
A backoff hint in milliseconds, when the platform sent one. retryAfter carries the same value under its previous name.
number
When the platform reported this failure. timestamp carries the same value under its previous name.
Example
There is no component field. It used to split codes by which tier of the platform failed ("api" / "gpu"); nothing on this side ever reported it, so match on code alone.

Error codes

Every code below has a matching exception class — the same code, the same fields, whether you catch it via instanceof or receive it through the error event.
Codes are open-ended. A command or control request the model itself rejects reports the platform’s own code, which this list cannot enumerate — that raises the base ReactorError with code set to whatever arrived. Match on error.code for anything not in the table; never assume an unrecognized code means the error was malformed.

TrackCapability

Describes a media track declared in the model’s capabilities. Track capabilities are provided by the server after session creation. You do not need to declare tracks on the client.
Definition
Track names are defined by the model and handled automatically by the SDK. Returned by reactor.tracks().

TrackMappingEntry

A TrackCapability plus its negotiated mid — the SDP media-section id.
Definition
Returned by reactor.trackMapping(), and carried alongside name/track/stream on the trackReceived event.

Capabilities

The model’s capabilities, received after session creation.
Definition
Access via reactor.getCapabilities() or the capabilitiesReceived event.
This is a translated, camelCase type — not what getSessionInfo()?.capabilities returns. The session response keeps the server’s raw wire shape (protocol_version, emission_fps, snake_case throughout); this type exists only on getCapabilities() and capabilitiesReceived. Prefer this one — see SessionResponse below.

SessionResponse

The full session resource exactly as the Reactor Platform reports it — the server’s raw wire shape, snake_case field names included. Returned by reactor.getSessionInfo().
Definition
capabilities here is the server’s raw shape, not the Capabilities type getCapabilities() returns — reading .protocolVersion off it is undefined, since the field is named protocol_version here. Use getCapabilities() for the translated type unless you specifically need another field off the session response.

Clip

A captured clip returned by requestClip() and requestRecording(). Pass it to ClipPlayer, ClipDownloadButton, or useClipDownload to play or save it.
Definition
A Clip is temporary. The URL it carries expires after 24 hours, so save the bytes locally if you need them later. See Recordings for usage.

RecordingError

Thrown by the recording APIs when a clip request, playback, or download fails.
Definition

Error codes

ClipDownloadState

State of an in-progress download, returned by useClipDownload.
Definition
total is 0 until the SDK knows how many segments to fetch. message is suitable for inline display.

ConnectionStats

WebRTC connection statistics returned by useStats() and the statsUpdate event.
Definition