Skip to main content
Every hook in the React SDK, grouped by subpath. Audio-pipeline hooks come from @mascotbot/react; Rive hooks from @mascotbot/react/rive.

Audio pipeline — @mascotbot/react

useMascot()

The licensed inference client from the enclosing <MascotProvider>. Gate audio work on status === "ready".

useProcessAudio(audioUrl)

Fetches the URL, decodes, resamples to 16 kHz, and runs inference once. Pass null to skip. result is a ProcessAudioResult:
Hand result.timeline to useMascotPlayback().setTimeline(), or JSON.stringify it to persist and replay later with zero reprocessing — Offline lip sync.

Rive layer — @mascotbot/react/rive

useMascotRive()

The Rive instance + canvas for the enclosing <Mascot>. rive is the raw, unmodified @rive-app/* instance — yours for data binding, custom inputs, events, and ViewModels. The SDK never wraps it. setImageAsset swaps a runtime image asset (e.g. a custom face texture).

useMascotInputs<T>()

This is the supported way to detect and drive non-mouth inputs. See Rive co-existence.

useMascotPlayback(options?)

Wraps the framework-agnostic MascotPlayback. stress([{ offset, stress }]) schedules emphasis cues — the SDK animates the Rive stress input from them on the playback clock (see Stress emphasis). Options:
Pass a stable naturalLipSyncConfig reference (a module constant or useState/useMemo). A fresh object literal every render reinitializes playback and breaks lip sync after the first chunk — Troubleshooting.

useLipsyncStream(args)

The unified audio→viseme stream for live audio: microphone, a tapped MediaStream (realtime providers, played audio), or manual chunk pushing. Full guide: Streaming & microphone.

Low-level Rive loaders

Next

Streaming & mic

useLipsyncStream in depth.

Offline lip sync

useProcessAudio → persist → replay.

Rive co-existence

Driving non-mouth inputs.