Quick start
Tracked-edit recording follows
documentMode. Set documentMode: 'suggesting' (or call superdoc.setDocumentMode('suggesting') later) to start recording new edits as revisions.Configuration
boolean
default:"false"
Show tracked-change markup when
documentMode is viewing.'review' | 'original' | 'final' | 'off'
Rendering mode.
boolean
default:"true"
Whether the layout engine treats tracked changes as active. Turn off to render the document without any revision UI.
'paired' | 'independent'
default:"'paired'"
How a tracked replacement (typing over selected text) surfaces in the API and UI. See Revision model.
Viewing mode visibility
Tracked-change markup is hidden by default whendocumentMode is 'viewing'. Flip modules.trackChanges.visible to show it in read-only mode.
The top-level
trackChanges key still works as a deprecated alias for modules.trackChanges and prints a one-time console warning.Revision model
SuperDoc supports two models for how a tracked replacement (an insertion paired with a deletion, created when a user types over selected text) shows up in the API and UI. Pick the one that matches the editor your users expect.
Both modes round-trip cleanly through DOCX: the OOXML always emits one
<w:ins> / <w:del> per mark. The difference is how the API surfaces the revisions at runtime.
Paired (default)
Independent (Word-style)
replacements: 'independent', editor.doc.trackChanges.list() returns one entry per revision and decide({ id }) resolves exactly that one side. The other half of the replacement stays in the document, still addressable by its own id: useful when you’re building a custom sidebar and want each revision as a separate row.
Document API
Use the Document API to list, read, and resolve tracked changes. It’s stable, typed, framework-agnostic, and works the same in the visual editor and headless mode.list() and get() has this shape:
Object
list() accepts an optional query with limit, offset, and type ('insert' | 'delete' | 'format') for pagination and filtering. See the full reference:
Toggling tracked edits
Control recording via document mode:Change types
Each mark carries
id, author, authorEmail, date, and: for imports from Word: the original w:id as sourceId so you can round-trip revision provenance.
Events
Tracked-change events are delivered through the sameonCommentsUpdate callback as comment events. The top-level type field tells them apart; filter on type === 'trackedChange' and read the flat payload.
Payload fields
Object
Events fire once per user action, not once per mark. A tracked replacement in paired mode emits one event with
trackedChangeType: 'both'. To enumerate the current set of revisions, use editor.doc.trackChanges.list(): not the event stream.Permissions
Accept and reject permissions are governed by the samepermissionResolver used for comments. Return false from the resolver to block an action.
See Comments → Permission resolver for the full list of permission types and resolver behavior.
Word import/export
Tracked changes round-trip through DOCX as native Word revisions. Import it. Edit it. Export it. Nothing lost.w:id values as wordRevisionIds on each TrackChangeInfo entry, so you can correlate SuperDoc revisions with the source document or an external review system.
Round-trip support today covers inserted run content (
<w:ins>), deleted run content (<w:del>), and run-level format changes (<w:rPrChange>). Paragraph-level property changes, tracked table row and cell edits, and tracked moves are on the roadmap: they import as accepted content today.Legacy editor commands
These legacy commands live onsuperdoc.activeEditor.commands and predate the Document API. They’re still used by the built-in toolbar and a handful of keyboard shortcuts.
Enable and toggle
Accept
Reject
Insert a tracked change programmatically
Object
required
View modes
Temporarily render the document without applying revisions: useful for previewing the accepted or original state:Full example
Track Changes Example
Runnable example: mode switching, accept and reject, comments sidebar, DOCX import and export.

