Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
npm install @liveblocks/client @liveblocks/yjs yjs
import { createClient } from "@liveblocks/client"; import { LiveblocksYjsProvider } from "@liveblocks/yjs"; import * as Y from "yjs"; import { SuperDoc } from "superdoc"; const client = createClient({ publicApiKey: "pk_..." }); const { room } = client.enterRoom("my-document"); const ydoc = new Y.Doc(); const provider = new LiveblocksYjsProvider(room, ydoc); provider.on("sync", (synced) => { if (!synced) return; new SuperDoc({ selector: "#editor", user: { name: "John", email: "john@example.com" }, modules: { collaboration: { ydoc, provider }, }, }); });
Was this page helpful?