Skip to content

Commit c68d5d4

Browse files
authored
docs: reposition self-hosted collaboration guidance (#3277)
SuperDoc Yjs was being framed as the "recommended" / "official" self-hosted package across the docs, examples README, and llms-full.txt. It is a minimal reference server with no built-in auth, persistence, scaling, or observability. Production teams should reach for established Yjs infrastructure. This PR makes Hocuspocus the recommended self-hosted default, introduces YHub as the advanced path for attribution and revision history (with beta and licensing caveats), and reframes SuperDoc Yjs as a reference implementation. It also marks the URL-managed provider path as deprecated in favor of the supported provider-agnostic contract: modules.collaboration = { ydoc, provider }. Drive-by fixes: remove the broken getActiveDocumentCount/getConnectionCount health-check example (those methods do not exist), fix the package README's broken default import and wrong class name in the Quick Start example, and remove the hocuspocus.mdx Next Steps card that funneled Hocuspocus users back to SuperDoc Yjs.
1 parent c04e785 commit c68d5d4

8 files changed

Lines changed: 97 additions & 74 deletions

File tree

apps/docs/editor/collaboration/overview.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ Collaboration is configured through `modules.collaboration` today, but it isn't
3434

3535
| Option | Best For |
3636
|--------|----------|
37-
| [SuperDoc Yjs](/guides/collaboration/superdoc-yjs) | Recommended: the official package |
38-
| [Hocuspocus](/guides/collaboration/hocuspocus) | TipTap ecosystem users |
37+
| [Hocuspocus](/guides/collaboration/hocuspocus) | Production self-hosted default. Mature, MIT, documented hooks and scaling. |
38+
| [YHub](https://github.com/superdoc-dev/superdoc/tree/main/examples/editor/collaboration/backends/fastapi/yjs-hub) | Advanced: attribution and revision history. Beta, Node 22+, AGPL/proprietary. |
39+
| [SuperDoc Yjs](/guides/collaboration/superdoc-yjs) | Minimal reference server. Not production infrastructure. |
3940

4041
</Tab>
4142
</Tabs>

apps/docs/editor/collaboration/quickstart.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ const client = createClient({
257257
<Card
258258
title="Self-Hosted Option"
259259
icon="server"
260-
href="/guides/collaboration/superdoc-yjs"
260+
href="/guides/collaboration/hocuspocus"
261261
>
262-
Run your own collaboration server
262+
Run your own collaboration server with Hocuspocus
263263
</Card>
264264

265265
<Card

apps/docs/guides/collaboration/hocuspocus.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,19 +286,19 @@ Server.configure({
286286
## Next steps
287287

288288
<CardGroup cols={2}>
289-
<Card
290-
title="SuperDoc Yjs"
291-
icon="rocket"
292-
href="/guides/collaboration/superdoc-yjs"
293-
>
294-
Try the official collaboration package
295-
</Card>
296-
297289
<Card
298290
title="Client Configuration"
299291
icon="settings"
300292
href="/editor/collaboration/configuration"
301293
>
302294
All SuperDoc collaboration options
303295
</Card>
296+
297+
<Card
298+
title="Self-hosted overview"
299+
icon="server"
300+
href="/guides/collaboration/self-hosted-overview"
301+
>
302+
Compare Hocuspocus, YHub, and the SuperDoc Yjs reference server
303+
</Card>
304304
</CardGroup>

apps/docs/guides/collaboration/self-hosted-overview.mdx

Lines changed: 66 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -36,68 +36,62 @@ flowchart TB
3636

3737
## Choose your approach
3838

39+
SuperDoc's collaboration is provider-agnostic: pass `{ ydoc, provider }` to `modules.collaboration` and the server choice is yours. We recommend established Yjs infrastructure for production deployments.
40+
3941
| Option | Best For | Setup Time |
4042
|--------|----------|------------|
41-
| [SuperDoc Yjs](/guides/collaboration/superdoc-yjs) | New projects, recommended | 30 mins |
42-
| [Hocuspocus](/guides/collaboration/hocuspocus) | TipTap ecosystem users | 30 mins |
43+
| [Hocuspocus](/guides/collaboration/hocuspocus) | Production self-hosted default. Mature, MIT-licensed, with documented auth, persistence, and Redis scaling. | 30 mins |
44+
| [YHub](https://github.com/superdoc-dev/superdoc/tree/main/examples/editor/collaboration/backends/fastapi/yjs-hub) | Advanced self-hosted. YHub supports attribution, activity, revision history, and Redis+Postgres scaling. Beta, Node 22+, AGPL or proprietary licensing. | 1+ hour |
45+
| [SuperDoc Yjs](/guides/collaboration/superdoc-yjs) | Minimal reference server for prototypes and local dev. Not production infrastructure. | 30 mins |
4346

4447
## Quick comparison
4548

4649
<Tabs>
47-
<Tab title="SuperDoc Yjs">
48-
**The official collaboration package**
50+
<Tab title="Hocuspocus">
51+
**Production self-hosted default**
4952

50-
- Purpose-built for SuperDoc
51-
- Builder pattern API
52-
- Auto-save with debounce
53-
- Memory management
53+
- Mature, MIT-licensed
54+
- Documented auth, persistence, Redis scaling
55+
- Rich extension ecosystem
5456

5557
```bash
56-
npm install @superdoc-dev/superdoc-yjs-collaboration
58+
npm install @hocuspocus/server @hocuspocus/provider
5759
```
5860

59-
[Get Started](/guides/collaboration/superdoc-yjs)
61+
[Get Started](/guides/collaboration/hocuspocus)
6062
</Tab>
6163

62-
<Tab title="Hocuspocus">
63-
**TipTap's Yjs server**
64+
<Tab title="YHub">
65+
**Advanced: attribution and revision history**
6466

65-
- Mature, battle-tested
66-
- Rich extension ecosystem
67-
- Good if already using TipTap
67+
- Built-in attribution, activity stream, changesets, rollback
68+
- Redis + Postgres backing
69+
- Beta, Node 22+, AGPL or proprietary
6870

69-
```bash
70-
npm install @hocuspocus/server
71-
```
71+
Reach for YHub when revision history and identity attribution are central to your product. Validate license and beta status before committing.
7272

73-
[Get Started](/guides/collaboration/hocuspocus)
73+
[See the example](https://github.com/superdoc-dev/superdoc/tree/main/examples/editor/collaboration/backends/fastapi/yjs-hub)
7474
</Tab>
7575

76-
</Tabs>
76+
<Tab title="SuperDoc Yjs">
77+
**Minimal reference server**
7778

78-
## Client connection options
79+
A small Yjs WebSocket server we ship for prototypes and local development. Not production infrastructure: no built-in auth, persistence, scaling, or observability. For production, use Hocuspocus or YHub.
7980

80-
When self-hosting, you have two ways to connect SuperDoc:
81+
```bash
82+
npm install @superdoc-dev/superdoc-yjs-collaboration
83+
```
8184

82-
### Option 1: URL-based (SuperDoc manages provider)
85+
[See the reference](/guides/collaboration/superdoc-yjs)
86+
</Tab>
8387

84-
SuperDoc creates and manages the WebSocket connection:
88+
</Tabs>
8589

86-
```javascript
87-
new SuperDoc({
88-
selector: '#editor',
89-
modules: {
90-
collaboration: {
91-
url: 'wss://your-server.com/doc',
92-
token: 'auth-token'
93-
}
94-
}
95-
});
96-
```
90+
## Client connection options
9791

98-
### Option 2: Provider-agnostic (You manage provider)
92+
The supported contract is provider-agnostic: you create the Yjs provider, SuperDoc plugs into it.
9993

100-
You create the Yjs provider yourself:
94+
### Provider-agnostic (recommended)
10195

10296
```javascript
10397
import { HocuspocusProvider } from '@hocuspocus/provider';
@@ -118,9 +112,25 @@ new SuperDoc({
118112
});
119113
```
120114

121-
<Note>
122-
The provider-agnostic approach gives you more control but requires managing the provider lifecycle yourself.
123-
</Note>
115+
This shape works with any Yjs provider: `HocuspocusProvider`, `WebsocketProvider` from `y-websocket` (compatible with YHub and SuperDoc Yjs), `LiveblocksYjsProvider`, or your own.
116+
117+
### URL-based (deprecated)
118+
119+
<Warning>
120+
This path is deprecated. SuperDoc creates the provider internally and emits a console warning. Use the provider-agnostic shape above for new code.
121+
</Warning>
122+
123+
```javascript
124+
new SuperDoc({
125+
selector: '#editor',
126+
modules: {
127+
collaboration: {
128+
url: 'wss://your-server.com/doc',
129+
token: 'auth-token'
130+
}
131+
}
132+
});
133+
```
124134

125135
## Requirements
126136

@@ -140,19 +150,27 @@ The provider-agnostic approach gives you more control but requires managing the
140150

141151
<CardGroup cols={2}>
142152
<Card
143-
title="SuperDoc Yjs"
144-
icon="rocket"
145-
href="/guides/collaboration/superdoc-yjs"
153+
title="Hocuspocus"
154+
icon="server"
155+
href="/guides/collaboration/hocuspocus"
146156
>
147-
Recommended - the official package
157+
Production self-hosted default
148158
</Card>
149159

150160
<Card
151-
title="Hocuspocus"
152-
icon="server"
153-
href="/guides/collaboration/hocuspocus"
161+
title="YHub example"
162+
icon="layers"
163+
href="https://github.com/superdoc-dev/superdoc/tree/main/examples/editor/collaboration/backends/fastapi/yjs-hub"
164+
>
165+
Advanced: attribution and revision history (beta)
166+
</Card>
167+
168+
<Card
169+
title="SuperDoc Yjs"
170+
icon="flask-conical"
171+
href="/guides/collaboration/superdoc-yjs"
154172
>
155-
Alternative using TipTap's server
173+
Minimal reference server for dev and prototypes
156174
</Card>
157175

158176
<Card

apps/docs/guides/collaboration/superdoc-yjs.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ sidebarTitle: SuperDoc Yjs
44
keywords: "superdoc collaboration server, yjs server, self-hosted, websocket"
55
---
66

7-
The official collaboration package for self-hosted deployments. Purpose-built for SuperDoc with a builder API.
7+
A minimal Yjs WebSocket server we ship as a reference implementation for prototypes and local development.
8+
9+
<Warning>
10+
This package is not production infrastructure. It has no built-in auth, persistence, scaling, or observability beyond what you wire into the hooks. For production self-hosted collaboration, use [Hocuspocus](/guides/collaboration/hocuspocus) (recommended default) or [YHub](https://github.com/superdoc-dev/superdoc/tree/main/examples/editor/collaboration/backends/fastapi/yjs-hub) (when attribution and revision history are central). SuperDoc's collaboration contract is provider-agnostic: pass `{ ydoc, provider }` to `modules.collaboration` and the server choice is yours.
11+
</Warning>
812

913
## Installation
1014

@@ -320,11 +324,7 @@ DATABASE_URL=postgres://user:pass@localhost/db
320324

321325
```typescript
322326
fastify.get('/health', (request, reply) => {
323-
reply.send({
324-
status: 'healthy',
325-
documents: collaboration.getActiveDocumentCount(),
326-
connections: collaboration.getConnectionCount()
327-
});
327+
reply.send({ status: 'healthy' });
328328
});
329329
```
330330

apps/docs/llms-full.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ Three preset themes included: Google Docs, Microsoft Word, and Blueprint.
253253

254254
## Collaboration
255255

256-
Real-time multiplayer editing using Yjs (CRDT). Providers supported:
256+
Real-time multiplayer editing using Yjs (CRDT). The supported integration contract is provider-agnostic: pass `{ ydoc, provider }` to `modules.collaboration` on the client. Server options:
257257
- Liveblocks (cloud)
258-
- SuperDoc Yjs server (self-hosted)
259-
- Hocuspocus (self-hosted)
258+
- Hocuspocus (recommended self-hosted default)
259+
- YHub (advanced self-hosted; beta; attribution and revision history use cases)
260+
- SuperDoc Yjs (minimal reference server, not production infrastructure)
260261

261262
---
262263

examples/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ Realtime providers and backend setups for Yjs-based collaboration.
7777

7878
| Example | Description |
7979
|---------|-------------|
80-
| [providers/superdoc-yjs](./editor/collaboration/providers/superdoc-yjs) | Self-hosted Yjs server (recommended) |
81-
| [providers/hocuspocus](./editor/collaboration/providers/hocuspocus) | Hocuspocus provider setup |
80+
| [providers/hocuspocus](./editor/collaboration/providers/hocuspocus) | Hocuspocus provider (recommended self-hosted default) |
8281
| [providers/liveblocks](./editor/collaboration/providers/liveblocks) | Liveblocks managed service |
82+
| [providers/superdoc-yjs](./editor/collaboration/providers/superdoc-yjs) | SuperDoc Yjs minimal reference server (not production infrastructure) |
83+
| [backends/fastapi/yjs-hub](./editor/collaboration/backends/fastapi/yjs-hub) | YHub server with attribution and activity stream (beta) |
8384
| [backends/node-sdk](./editor/collaboration/backends/node-sdk) | Server-side document operations alongside the realtime layer |
8485
| [backends/fastapi](./editor/collaboration/backends/fastapi) | Python FastAPI backend |
8586

packages/collaboration-yjs/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# SuperDoc Yjs collaboration library
22

3-
`@superdoc-dev/superdoc-yjs-collaboration` is a library for integrating Yjs-based real-time collaborative editing into any Node.js WebSocket-enabled server framework. It is designed to work out-of-the-box for **SuperDoc**.
3+
`@superdoc-dev/superdoc-yjs-collaboration` is a minimal Yjs WebSocket server for SuperDoc, shipped as a reference implementation for prototypes and local development.
4+
5+
> **Not production infrastructure.** No built-in auth, persistence, scaling, or observability beyond what you wire into the hooks. For production self-hosted collaboration, use [Hocuspocus](https://tiptap.dev/docs/hocuspocus) (recommended default) or [YHub](https://github.com/yjs/yhub) (when attribution and revision history are central). SuperDoc's collaboration contract is provider-agnostic: pass `{ ydoc, provider }` to `modules.collaboration` on the client and the server choice is yours.
46
57
It provides:
68

@@ -66,7 +68,7 @@ Below is an example using Fastify, but you can adapt it to any server framework.
6668
import Fastify from 'fastify';
6769
import websocket from '@fastify/websocket';
6870
import { v4 as uuidv4 } from 'uuid';
69-
import SuperDocCollaboration from '@superdoc-dev/superdoc-yjs-collaboration';
71+
import { CollaborationBuilder } from '@superdoc-dev/superdoc-yjs-collaboration';
7072

7173
const app = Fastify();
7274
app.register(websocket);
@@ -79,7 +81,7 @@ const onLoad = (params) => {}; // Load your document from persistence (ie: S3)
7981
const onAutoSave = (params) => {}; // Debounced onChange hook based on 'withDebounce' setting. Save to persistence.
8082
const onChange = (params) => {}; // On change hook. This gets triggered a lot!
8183

82-
const service = new SuperDocCollaboration()
84+
const service = new CollaborationBuilder()
8385
.withName(`sdc-${uuidv4()}`)
8486
.withDebounce(500)
8587
.onAuthenticate(onAuthenticate)

0 commit comments

Comments
 (0)