Installation
1. Install the package
- npm
- Yarn
- pnpm
- Bun
npm install @fishjam-cloud/react-client
yarn add @fishjam-cloud/react-client
pnpm add @fishjam-cloud/react-client
bun add @fishjam-cloud/react-client
2. Setup Fishjam context
Wrap your app in our FishjamProvider
component. Get your Fishjam ID from Fishjam Dashboard and pass it to the provider.
import React from "react"; import ReactDOM from "react-dom/client"; // import App from "./App"; import { FishjamProvider } from "@fishjam-cloud/react-client"; // Check https://fishjam.io/app/ for your Fishjam ID const FISHJAM_ID = "your-fishjam-id"; ReactDOM.createRoot(document.getElementById("root")!).render( <React.StrictMode> <FishjamProvider fishjamId={FISHJAM_ID}> <App /> </FishjamProvider> </React.StrictMode>, );
tip
It's possible to have many independent Fishjam contexts in one app.
Just render many FishjamProvider
components and make sure they don't overlap.