EngineeringApril 13, 20261 min read

Real-time Collaboration in docx-js-editor

Set up real-time DOCX editing with Yjs: shared cursors, presence, comment sync, and tracked-change attribution across browsers.

0.x postThis post uses the 0.x package names and APIs. For the current release see the 2.x docs.

@eigenpal/docx-js-editor@0.0.34 adds real-time collaboration via Yjs: live cursors, presence, comment sync, and tracked-change attribution across browsers. It works with y-webrtc, y-partykit, @liveblocks/yjs, @hocuspocus/provider, or any Yjs provider.

Try the collaboration demo to create and open a collaboration room. Share the URL with another participant.

Three collaboration props

<DocxEditor
  document={createEmptyDocument()}
  externalContent
  externalPlugins={plugins}        // ySyncPlugin, yCursorPlugin, yUndoPlugin
  comments={comments}              // controlled, mirrored to a Y.Array
  onCommentsChange={setComments}
/>

externalContent makes Yjs the document state source. Tracked changes synchronize as part of the ProseMirror tree. Comments use the controlled API because their thread metadata remains outside the document.

Resources