Skip to content

Modules

Three packages make up reactor-effect, released together under one version. Each module is its own subpath, and each package’s root exports every module as a namespace:

import { H3, Playout, Reactor } from "reactor-effect-client";
import * as Session from "reactor-effect-client/Session";

The packages are ES modules with no side effects on import. Their export maps open . and ./<Module> and close ./internal/*, so nothing internal is reachable. Each module’s doc comments state every option’s default and bound; this page is the map.

The portable core: the coordinator’s HTTP API, sessions, the wire protocol, the H3, FastH3 and Vidu S2-Avatar providers, the playout and the simulated Reactor. It runs on Node, Bun and browsers, and importing it selects no host and loads no native code.

Module What it is
Reactor The service that acquires sessions: create allocates one, attach joins one
Session One session: its status, events, commands, uploads, recordings, media and close report
CoordinatorClient Reactor’s HTTP API: tokens, pricing, inspection, termination and recordings
H3 The H3 Reference Turbo Realtime provider over a session
FastH3 The FastH3 provider over a session: frames or clip ids as opener and closer
ViduS2Avatar The Vidu S2-Avatar provider over a session: an avatar and its calls
References Reference images and voice samples from a data URI, a file or a URL, bounded and validated
Playout A keyed schedule in priority lanes, aired across sessions it renews
H3Source A paid H3 session as a playout source
FastH3Source A paid FastH3 session as a playout source, with built retained continuation hints
LocalSource A playout source rendered in this process by your own hooks
Ledger The paid sessions you own, recorded before they connect and ended until Reactor confirms it
Media Decoded frames and platform tracks of one connection generation
Peer The transport port a host implements
ReactorError Every failure the client raises, its reason and its dispatch outcome
ReactorTest Reactor simulated in memory, on the Effect clock

reactor-effect-client/Reactor. The Reactor service (create, attach), layer(options) and make, Options (the session deadlines and reconnect schedule), CreateOptions, AttachOptions, and noAcquisition, the close report of an acquisition that allocated nothing. See Sessions and tokens.

reactor-effect-client/Session. The Session interface, Snapshot and Status, CloseReport (a Schema) and mayStillBill, CommandReply and CommandOptions, SessionEvent, Observation, ClipReady and ControlMessage (Schemas), UploadReference, Statistics.

reactor-effect-client/CoordinatorClient. The CoordinatorClient service (tokens, mintToken, pricing, inspect, terminate, downloadClip, signaling), layer(options), layerConfig (REACTOR_API_URL, REACTOR_API_KEY) and make; Tokens, TokenGrant, TokenOptions, Granted and fixedTokens; modelRate and Rate; isTerminal, Termination, ConfirmedTermination and Inspection; terminateUntilConfirmed, which ends a session and asks again until Reactor confirms it; defaultApiUrl.

reactor-effect-client/H3. make and the Provider interface; Request and Reference (Schemas), validateReference and validateAudioReference; the model’s profile: modelName, documentedVersion, requestSeconds, referenceLimits, audioReferenceLimits, canvases, h3ReferenceTurboRealtime, alignFrames, isRequestableSeconds, estimateTokens; H3’s Clip, Queue and State Schemas; Acceptance, Submission, ClipOperation and ProviderSnapshot. See The H3 provider.

reactor-effect-client/FastH3. make, Provider and Options; modelName, tracks, documentedVersion, source, requestSeconds and canvases; the Request, Clip, Queue and State Schemas; Acceptance, Submission, ProviderSnapshot and the clip’s operation facts. Frames or clip ids supply a clip’s opener and closer. FastH3Source opens and owns a session for the playout. See FastH3 and Air FastH3 through the playout.

reactor-effect-client/ViduS2Avatar. make and the Provider interface, Options, ObservationOptions and ProviderEvent; modelName and tracks; what a caller sends, as Schemas: AvatarImage, ImageType, Call, CallUpdate, Vad, Llm and ReferenceImage; what the model reports: State, Phase, Transcript, Voice, Voices, CallEnded and CommandError. See A talking character.

reactor-effect-client/References. image and audio, which read a reference and validate it as H3 does; read, which reads its bytes alone; the Location (DataLocation, FileLocation or UrlLocation) that file, url and locate make; ReadOptions (maxBytes, 16 MiB by default, and timeout). A file needs a FileSystem and a URL an HttpClient; no error or span names the location. See Loading references.

reactor-effect-client/Playout. The H3 Playout service, generic Service<Req>, make, layer and lineup; Options, ModelOptions, ClipModel and ClipRequest; the item specs ItemSpec, GroupSpec, InsertSpec, Edit, LaneSpec, Start, Window, Cue, PlaceProbe and Placement; ItemKey (a branded Schema); the evidence AsRunStatus, AsRunEvent, Settled, Event, SessionEvent and State; the source contract Source, SourceEvent and SourceState; Cleanup; and the errors InvalidItem, KeyMismatch, LaneBusy, WouldMissDeadline, PlayoutClosed and InvalidFiller. See Playout.

reactor-effect-client/H3Source: open, resume, opener (for a Ledger), model, the owner record Allocation (a Schema), Allocated, OpenOptions and ResumeOptions. reactor-effect-client/LocalSource: open, Options, LocalClip, Rendered and Sink. See Sources.

reactor-effect-client/Ledger. The Ledger service (source, release, entries); layer(options) over the application’s Store, layerFile(path, options) and layerMemory(options); the Store port and its Entry (a Schema); Opener, which H3Source.opener and FastH3Source.opener make; SourceOptions, Options, Released and LedgerError. One store belongs to one process and one Reactor account. See Cost control.

reactor-effect-client/Media. DecodedMedia, TrackMedia, VideoFrame, AudioFrame, VideoFormat, MediaPressure, and recorder with its Recorded view. See Media.

reactor-effect-client/Peer. The PeerFactory service and the Peer interface a host implements, PeerMedia, trackFeed for a host’s received tracks, MediaTrack, and the transport Schemas Track, Mapping, IceServer, IceCandidate, PeerEvent, PeerState and DataChannel. An application needs it only to write a host of its own.

reactor-effect-client/ReactorError. The classes ReactorError, CommandFailure and AcquisitionFailure, the union ReactorFailure and isReactorFailure; the reasons Failure (with its FailureCode), Http, Remote, Refused, Native, IceFailed, TransportFailed and ClipEnded; RemoteOutcome, ErrorContext and CommandContext; FailureSummary and summarize. See Errors.

reactor-effect-client/ReactorTest. layer (the simulated coordinator and host) and layerCoordinator (the coordinator alone); the ReactorTest service (apiKey, sessions, billing, log, inject); Timing (fixed, random, hosted); Fault; Options; flow for TestClock; frameOf; pngBytes and wavBytes. See Test offline.

The browser host. It binds the Peer port to RTCPeerConnection and plays the session’s own tracks. It has no Node dependency.

Module What it is
BrowserPeer layer, the PeerFactory over the browser’s WebRTC; building it checks for RTCPeerConnection and MediaStream
BrowserMedia tracks(session), the generation’s tracks as DOM MediaStreamTracks, and play(track, element)

The native host. It binds the Peer port to a Node-API addon over Reactor’s reactor-webrtc crate (libwebrtc) and delivers decoded media in Node and Bun.

Module What it is
NativePeer layer(options) in process, and layerIsolated(options) with a child process per connection; Options (addon, shutdownTimeout)

Each platform’s addon ships in its own package, which reactor-effect-native lists as an exact-version optional dependency, so a package manager installs only the one the host can run. Importing NativePeer loads no addon: building its layer does.

Package Peer dependencies Runs on
reactor-effect-client effect ~4.0.0 Node 22 or newer, Bun, browsers
reactor-effect-browser effect ~4.0.0, reactor-effect-client at exactly the same version Browsers with WebRTC
reactor-effect-native effect, @effect/platform-node and @effect/platform-node-shared ~4.0.0, reactor-effect-client at exactly the same version Node 22 or newer and Bun
Addon package Platform
reactor-effect-native-linux-x64-gnu Linux x64 with glibc
reactor-effect-native-darwin-arm64 macOS on Apple silicon, macOS 13 or later
Host Media Runtime
NativePeer.layer() Decoded BGRA frames and PCM Node and Bun, in process
NativePeer.layerIsolated() Decoded, from a child per connection Node only
BrowserPeer.layer The browser’s own tracks Any browser with WebRTC
ReactorTest.layer Decoded synthetic frames Anywhere the client runs

The Effect peers admit 4.0.x patches and stop before 4.1, because the Effect modules these packages build on are marked unstable, and Effect may change those in a minor release: Effect 4.1 needs a new release of these packages. See Installation for the install lines.