Quick start
Editor.open() is the recommended way to create an editor. It handles DOCX parsing, extension setup, and mounting automatically.
Required parameters
The document source. Can be a file path (Node.js), File/Blob (browser), or Buffer.
DOM element where the editor will mount. If omitted, the editor runs in headless mode.
Unique identifier for this document instance. Used for collaboration and
storage. Auto-generated if not provided.
Extensions that define the editor schema and functionality. If omitted,
Editor.open() uses sensible defaults (getStarterExtensions() for DOCX, getRichTextExtensions() for text/HTML).Modes & permissions
Editor rendering mode
Current editing state
User permission level. Overrides documentMode when more restrictive.
Role always wins over documentMode in permission conflicts
Whether the editor accepts input
User & collaboration
Current user information
All users with document access. Used for @mentions and awareness.
Yjs document for real-time collaboration
Provider instance for collaboration sync
Content initialization
Initialize with HTML content (for
mode: 'html')Initialize with Markdown (converts to document)
Use ProseMirror JSON content instead of DOCX parsing
Features
Enable comments system
Enable field annotations
Enable page-based layout
Advanced options
Run without mounting an editor view (Node.js/server-side processing).
Automatically set to
true when no element is provided to Editor.open().DOM Document for serialization in headless mode (e.g.,
window.document from JSDOM).Y.Doc XML fragment for collaborative document content. Use with headless mode to read Y.Doc content.
Custom image upload handler
Configuration patterns
Full DOCX editor
Headless converter (Node.js)
Convert DOCX files server-side without a browser using JSDOM.See the headless-converter
example
for a complete implementation.
Headless Y.Doc to HTML (collaboration)
Read content from a collaborative Y.Doc in your backend — useful for AI agents or APIs that need to access document content without a browser.Even with headless mode, methods like
getHTML() need a DOM for serialization. JSDOM is set up automatically in Node.js when using Editor.open().
