Self-hosted CRDT sync server using Yjs (y-websocket protocol) and Automerge, with Postgres persistence. Build collaborative text editors, whiteboards, and real-time shared state without third-party services. A drop-in replacement for Liveblocks or PartyKit — on your own infrastructure.
Set your license key with nself license set nself_pro_... before installing.
nself license set nself_pro_...
nself plugin install crdt
nself build
nself startimport * as Y from 'yjs'
import { WebsocketProvider } from 'y-websocket'
const ydoc = new Y.Doc()
const provider = new WebsocketProvider(
'ws://your-nself-host/crdt',
'my-document-id',
ydoc
)
// Collaborative text
const ytext = ydoc.getText('content')
ytext.insert(0, 'Hello, collaborative world!')| Variable | Required | Default | Description |
|---|---|---|---|
PLUGIN_CRDT_PERSISTENCE | No | postgres | Persistence backend: postgres or memory |
PLUGIN_CRDT_SNAPSHOT_INTERVAL | No | 100 | Compact to snapshot every N updates |
PLUGIN_CRDT_MAX_CONNECTIONS | No | 1000 | Max simultaneous WebSocket connections |
| Endpoint | Method | Description |
|---|---|---|
/crdt (WebSocket) | WS | y-websocket sync endpoint — connect with room name as path param |
/crdt/rooms | GET | List active rooms with connection count |
/crdt/rooms/:id | DELETE | Evict all clients and delete document state |
/health | GET | Plugin health check |
nself plugin remove crdtCategory: Infrastructure | Last Updated: April 2026 | Plugin Version 1.1.1