Collaboration Options
ProseKit supports two collaboration backends:| Library | Description | Best For |
|---|---|---|
| Yjs | Mature CRDT library with extensive ecosystem | Production applications, WebRTC, WebSocket |
| Loro | Modern CRDT library with time-travel and efficient sync | New projects, advanced features |
Collaboration with Yjs
Yjs is a mature CRDT implementation with a rich ecosystem of providers for different network transports.Display collaborator cursors
The Yjs extension automatically handles cursor synchronization. You can customize cursor appearance with CSS:
Complete Yjs Example
Collaboration with Loro
Loro is a modern CRDT library with efficient synchronization and time-travel capabilities.Complete Loro Example
Setting Up a WebSocket Server
For Yjs, you can use the officialy-websocket server:
Network Providers
WebSocket Provider (Yjs)
WebRTC Provider (Yjs)
For peer-to-peer collaboration without a server:Offline Support
Both Yjs and Loro support offline editing with automatic sync when reconnected:Troubleshooting
Connection issues
If clients can’t connect:- Verify WebSocket server is running
- Check firewall and network settings
- Ensure WebSocket URL is correct
- Check browser console for errors
- Verify CORS settings if needed
Sync conflicts
If you’re seeing sync conflicts:- CRDTs should handle conflicts automatically
- Verify all clients use the same document ID
- Check that updates are being sent/received
- Ensure peer IDs are unique
Cursor positions not syncing
If cursors aren’t showing:- Verify awareness is properly configured
- Check that user information is set
- Ensure cursor CSS is loaded
- Verify cursor plugin is included
Performance issues
For large documents or many collaborators:- Use incremental updates instead of snapshots
- Implement debouncing for frequent changes
- Consider document size limits
- Use efficient network protocols
- Implement pagination for large documents
Next Steps
- Server-Side Rendering - Use ProseKit on the server
- Custom Extensions - Build custom functionality
- Saving and Loading - Persist editor content