Documentation Index
Fetch the complete documentation index at: https://docs.reactor.inc/llms.txt
Use this file to discover all available pages before exploring further.
useReactor()
Selects state from the Reactor store. Uses shallow comparison to avoid unnecessary re-renders.
Signature
A function that picks values from the store.
Example
Store properties
| Property | Type | Description |
|---|---|---|
status | ReactorStatus | Current connection status |
lastError | ReactorError | undefined | Most recent error |
tracks | Record<string, MediaStreamTrack> | Received tracks by name |
sessionId | string | undefined | Current session ID |
connect | (jwtToken?: string, options?: ConnectOptions) => Promise<void> | Connect to the model |
disconnect | (recoverable?: boolean) => Promise<void> | Disconnect |
reconnect | (options?: ConnectOptions) => Promise<void> | Reconnect to existing session |
sendCommand | (command: string, data: object) => Promise<void> | Send a command |
uploadFile | (file: File | Blob, options?: { name?: string }) => Promise<FileRef> | Upload a file |
publish | (name: string, track: MediaStreamTrack) => Promise<void> | Publish a track |
unpublish | (name: string) => Promise<void> | Stop publishing a track |
The store exposes
publish / unpublish; the base Reactor class names the same operations
publishTrack /
unpublishTrack. Use whichever matches your entry
point (hook store vs. class instance).useReactorMessage()
Subscribes to application-level messages from the model. Handles React lifecycle automatically.
Signature
Called each time the model sends a message. The shape of
message depends on the model.Example
This hook only receives
application-scoped messages. Internal platform messages are handled by the SDK.useStats()
Returns live WebRTC connection statistics, updated every 2 seconds while connected.
Signature
Example
ConnectionStats for all available fields.
useClipDownload()
Headless primitive for downloading a Clip. Wraps reactor.downloadClipAsFile() and exposes the state of the in-flight download so you can render your own button, progress bar, or menu item.
Signature
Filename used by the browser save dialog. Pass
null to skip the save dialog and just resolve with the Blob.Resolver for the auth token. Required against
https://api.reactor.inc. See Authentication.| Property | Type | Description |
|---|---|---|
state | ClipDownloadState | Current state of the download. |
download | () => Promise<Blob | undefined> | Starts the download. A no-op while one is in flight. Errors are surfaced via state, not thrown. |
reset | () => void | Resets state to idle. Does not cancel an in-flight download. |
Example
ClipDownloadButton.