SuperDoc uses Yjs, a CRDT (Conflict-free Replicated Data Type) library, to enable real-time collaboration. Changes are synchronized through WebSocket connections to ensure all users see the same document state.
For multiple collaborative documents in one SuperDoc:
Copy
documents: [ { id: 'doc-1', // Used as collaboration room type: 'docx', data: docxBlob }, { id: 'doc-2', // Different room type: 'docx', url: 'document2.docx' }]// Each document gets its own collaboration room// based on the document ID