Browser-only React SDK for Fishjam — joining rooms, capturing camera/microphone/screen, displaying peers, and acting as a livestream streamer or viewer in a React web app. Use whenever the user is writing a React app in a browser that calls Fishjam APIs, sets up FishjamProvider, or uses any Fishjam React hook. Trigger on: '@fishjam-cloud/react-client', 'FishjamProvider', 'useConnection', 'useCamera', 'useMicrophone', 'useScreenShare', 'usePeers', 'useDataChannel', 'useVAD', 'useLivestreamStreamer', 'useLivestreamViewer', 'useCustomSource', 'useInitializeDevices', 'useUpdatePeerMetadata', 'useSandbox', 'PeerWithTracks', 'joinRoom', 'peerToken', 'fishjamId', 'fishjam react', '@fishjam-cloud/ts-client', 'FishjamClient ts-client'. Covers the provider, the full hook catalog, simulcast configuration, custom sources, data channels, VAD, livestream WHEP playback, device persistence, and reconnection. Briefly notes when to drop down to @fishjam-cloud/ts-client for non-React or worker contexts.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Browser-only React SDK for Fishjam — joining rooms, capturing camera/microphone/screen, displaying peers, and acting as a livestream streamer or viewer in a React web app. Use whenever the user is writing a React app in a browser that calls Fishjam APIs, sets up FishjamProvider, or uses any Fishjam React hook. Trigger on: '@fishjam-cloud/react-client', 'FishjamProvider', 'useConnection', 'useCamera', 'useMicrophone', 'useScreenShare', 'usePeers', 'useDataChannel', 'useVAD', 'useLivestreamStreamer', 'useLivestreamViewer', 'useCustomSource', 'useInitializeDevices', 'useUpdatePeerMetadata', 'useSandbox', 'PeerWithTracks', 'joinRoom', 'peerToken', 'fishjamId', 'fishjam react', '@fishjam-cloud/ts-client', 'FishjamClient ts-client'. Covers the provider, the full hook catalog, simulcast configuration, custom sources, data channels, VAD, livestream WHEP playback, device persistence, and reconnection. Briefly notes when to drop down to @fishjam-cloud/ts-client for non-React or worker contexts.
license
MIT
Fishjam React Client
@fishjam-cloud/react-client — Fishjam's React SDK for browser apps. Wrap your app in FishjamProvider, then use hooks to drive devices, connection, and peers.
Read ../platform/SKILL.md first. It defines what rooms, peers, tokens, and the sandbox-vs-prod model are. This skill assumes those.
For React Native, use ../react-native-client/SKILL.md instead — it re-exports this hook surface and adds mobile-only concerns.
Minimal setup
npm install @fishjam-cloud/react-client
# or yarn add @fishjam-cloud/react-client
Use Fishjam from non-React code (workers, Svelte, vanilla TS)
@fishjam-cloud/ts-client
ts-client-escape.md
Key rules
One FishjamProvider per app. Don't nest. It owns the FishjamClient, all device managers, and reconnection state.
useSandbox is dev-only. Gate it with if (import.meta.env.DEV) (or equivalent) so a sandbox URL can never ship in a production bundle.
Browser requires user gesture for useScreenShare — call inside an onClick, not on mount.
Devices stay mounted across connection state. Initializing with useInitializeDevices once is enough — they remain available after you leaveRoom.
Livestream rooms have a one-track-per-direction constraint. One video + one audio on the streamer; viewers don't publish.
For non-React contexts (Svelte, Vue, workers, vanilla TS), use @fishjam-cloud/ts-client directly. The React SDK is a thin layer over it. See ts-client-escape.md.
The provider re-exports Variant from ts-client for simulcast quality (Variant.VARIANT_LOW | Variant.VARIANT_MEDIUM | Variant.VARIANT_HIGH).