@conference-kit/nextjs
v0.0.5
Published
Next.js-friendly entry point for the React bindings plus client-only helpers.
Downloads
496
Readme
@conference-kit/nextjs
Next.js-friendly entry point for the React bindings plus client-only helpers.
Install
npm install @conference-kit/nextjsPeer deps: Next 13+, React 18+.
What you get
- Re-exports everything from
@conference-kit/reactfor direct use in app/router components. isClient: boolean flag (typeof window !== "undefined").dynamicClient(factory, loading?): wrapsnext/dynamicwithssr: falseto load browser-only components (e.g., ones that callgetUserMedia).
Usage
import { dynamicClient, useMeshRoom } from "@conference-kit/nextjs";
const MeshClient = dynamicClient(() => import("./Mesh"));
export default function Page() {
return <MeshClient />;
}
// Mesh.tsx (client component)
("use client");
import { useMeshRoom } from "@conference-kit/nextjs";
export default function Mesh() {
const mesh = useMeshRoom({
peerId: "a",
room: "lobby",
signalingUrl: "ws://localhost:8787",
});
return <div>Peers: {mesh.participants.length}</div>;
}Build
npm run buildEmits ESM + types to dist/.
