---
title: "Use tracked changes and editor modes in Document Authoring"
canonical_url: "https://www.nutrient.io/guides/document-authoring/review-and-collaboration/tracked-changes-and-editor-modes/"
md_url: "https://www.nutrient.io/guides/document-authoring/review-and-collaboration/tracked-changes-and-editor-modes.md"
last_updated: "2026-07-08T00:00:00.000Z"
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 tracked changes with Document Authoring AI

Document Authoring AI uses the same editor modes as the rest of the editor. Your app decides how AI write operations are applied:

- In `edit` mode, AI writes can apply immediately.

- In `review` mode, AI writes can be routed through tracked changes, so users can accept or reject them.

- In `view` mode, AI writes should be blocked, while read-only AI tools can still inspect the document.

Set the editor author before running AI writes in `review` mode so tracked changes are attributed to the right user or team. For the AI-specific policy and `writeMode: "track_changes"` examples, refer to [review and approval in Document Authoring AI](https://www.nutrient.io/guides/document-authoring/ai/review-and-approval.md).

## 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/editing-content/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/review-and-collaboration/comments-and-review-workflows.md)

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

- [Review and approval in Document Authoring AI](https://www.nutrient.io/guides/document-authoring/ai/review-and-approval.md)
---

## Related pages

- [Review documents with comments](/guides/document-authoring/review-and-collaboration/comments-and-review-workflows.md)
- [Manage comments and review edits from code](/guides/document-authoring/review-and-collaboration/programmatic-comments.md)

