> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Collaboration

Enable multiple users to edit the same document simultaneously with real-time collaboration powered by [Yjs](https://docs.yjs.dev/).

> [!NOTE]
>
> Collaboration is configured through `modules.collaboration` today, but it isn't a built-in UI surface. It controls document sync, providers, presence, and persistence for collaborative editing: infrastructure, not rendering. Use it alongside any UI choice ([Custom UI](https://docs.superdoc.dev/editor/custom-ui/overview.md), built-in UI, or both).

[Embedded content](https://superdoc-collab-example.pages.dev/doc/example?hide-toolbar=true)

## Choose your approach

> [tab] Cloud Providers
>
> No server to manage: get started in minutes.
>
> | Provider | Best For | Pricing |
> | - | - | - |
> | [Liveblocks](https://docs.superdoc.dev/guides/collaboration/liveblocks.md) | Quick start, any framework | Free tier available |

> [tab] Self-Hosted
>
> Full control over your data and infrastructure.
>
> | Option | Best For |
> | - | - |
> | [YHub](https://docs.superdoc.dev/guides/collaboration/yhub.md) | Advanced Yjs backend for attribution, activity, and revision-history workflows. Beta. |
> | [Hocuspocus](https://docs.superdoc.dev/guides/collaboration/hocuspocus.md) | Mature self-hosted Yjs server with auth, persistence, and scaling hooks. |
> | [SuperDoc Yjs](https://docs.superdoc.dev/guides/collaboration/superdoc-yjs.md) | Minimal reference server. Not production infrastructure. |

## Quick start

Get collaboration working in 5 minutes with Liveblocks:

```bash theme={null}
npm install @liveblocks/client @liveblocks/yjs yjs
```

```javascript theme={null}
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 },
    },
  });
});
```

See the [full quickstart guide](https://docs.superdoc.dev/editor/collaboration/quickstart.md) for framework-specific examples (React, Vue, Vanilla JS).

## Start collaborative immediately or later

> [card] [Start in collaboration mode](https://docs.superdoc.dev/editor/collaboration/quickstart.md)
>
> Create your Yjs provider first, then pass `{ ydoc, provider }` in
> `modules.collaboration` when you construct `SuperDoc`.

> [card] [Upgrade later](https://docs.superdoc.dev/editor/collaboration/upgrade-to-collaboration.md)
>
> Mount a local `SuperDoc` first, then call
> `superdoc.upgradeToCollaboration({ ydoc, provider })` when the user creates
> a shared room.

If you are also using the SDK for backend automation, see [SDK collaboration sessions](https://docs.superdoc.dev/document-engine/sdks.md#collaboration-sessions).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.