---
title: "Use tracked changes and editor modes in Document Authoring"
canonical_url: "https://www.nutrient.io/guides/document-authoring/editing-and-review/tracked-changes-and-editor-modes/"
md_url: "https://www.nutrient.io/guides/document-authoring/editing-and-review/tracked-changes-and-editor-modes.md"
last_updated: "2026-06-08T17:11:05.445Z"
description: "Learn how to switch between edit, review, and view modes in Document Authoring, create tracked changes during review, and set the author used for revisions."
---

# Use tracked changes and editor modes

Before you start, ensure the Document Authoring library is installed and running. Refer to the [getting started](https://www.nutrient.io/sdk/document-authoring/getting-started.md) guide.

Document Authoring supports tracked changes for review workflows. Reviewers can create tracked revisions for supported edits in the editor, inspect tracked changes, and accept or reject them in the UI.

The example code omits error handling. Add it before using this code in production.

## Understand the editor modes

Document Authoring supports three editor modes:

- `edit` — Regular editing mode. Changes apply directly, while existing tracked changes remain visible.

- `review` — New edits are recorded as tracked revisions, while tracked changes remain visible.

- `view` — Read-only mode. Editing is disabled, while tracked changes remain visible.

Use [`editor.getEditorMode()`](https://www.nutrient.io/api/document-authoring/types/docautheditor/#geteditormode) to inspect the current mode:

```js

const mode = editor.getEditorMode();
console.log(mode);

```

## Switch modes at runtime

Use [`editor.setEditorMode(mode)`](https://www.nutrient.io/api/document-authoring/types/docautheditor/#seteditormode) to move between editing states:

```js

editor.setEditorMode('edit');
editor.setEditorMode('review');
editor.setEditorMode('view');

```

This is useful when your application needs separate drafting, review, and read-only steps.

## Create tracked changes in review mode

When the editor is in `review` mode, supported edits are recorded as tracked changes instead of being applied silently.

```js

editor.setAuthor('Jane Reviewer');
editor.setEditorMode('review');

```

After switching to review mode, editor changes are recorded as revisions for the current author.

## Set the author used for tracked changes

Use [`editor.setAuthor(name)`](https://www.nutrient.io/api/document-authoring/types/docautheditor/#setauthor) to control the author name used for new tracked changes, comments, and replies:

```js

editor.setAuthor('Legal Team');

```

Read the current author with [`editor.getAuthor()`](https://www.nutrient.io/api/document-authoring/types/docautheditor/#getauthor):

```js

const author = editor.getAuthor();
console.log(author);

```

Clear the author name to fall back to a localized anonymous label:

```js

editor.setAuthor('');

```

## Review and resolve tracked changes in the UI

Tracked changes can be reviewed directly in the editor UI. Revisions can show inserted or deleted content and other supported formatting or document property changes.

Reviewers can inspect each revision and accept or reject it in the editor.

## Use review transactions together with programmatic editing

Use review transactions to create tracked revisions from code with [`DocAuthDocument.transaction()`](https://www.nutrient.io/api/document-authoring/types/docauthdocument/#transaction). Supported mutations are recorded as revisions for the supplied author. Mutations without tracked-change markup support still apply directly without revisions.

```js

const currentDoc = editor.currentDocument();

await currentDoc.transaction(
  async ({ draft }) => {
    const paragraph = draft.body().content().addParagraph();
    paragraph.asTextView().setText('This change is authored in review mode.');

    return true;
  },
  {
    review: {
      author: 'Nutrient Docs',
    },
  },
);

```

For a full walkthrough of programmatic review transactions, refer to the [programmatic editing](https://www.nutrient.io/guides/document-authoring/working-with-documents/programmatic-editing.md) guide.

## Learn more

- [Document Authoring API reference](https://www.nutrient.io/api/document-authoring/)

- [Comments](https://www.nutrient.io/guides/document-authoring/editing-and-review/comments-and-review-workflows.md)

- [Programmatic editing](https://www.nutrient.io/guides/document-authoring/working-with-documents/programmatic-editing.md)
---

## Related pages

- [Use spellcheck in Document Authoring](/guides/document-authoring/editing-and-review/spellcheck.md)
- [Review documents with comments](/guides/document-authoring/editing-and-review/comments-and-review-workflows.md)

