Using the Feature of Track Changes

Do you want to: Ask a how-to question
Question : so the how -to question is regarding how to enable the track changes option becoz by default the track changes is set to " OFF for me and everyone" I want to change it to “ON for me and everyone” using code but not able to do it. the appoach i am using is :
I enabled the basic flag in the editor config to suggest that Track Changes should be enabled:
editorConfig: {

customization: {
features: {
trackChanges: true
}
},

}

However, I realized this alone doesn’t always enable it immediately for everyone in collaborative mode.


To guarantee the setting takes effect and persists for all users, I used the executeMethod() API call inside the onDocumentReady event. This explicitly enables track changes after the document is fully loaded:

onDocumentReady: () => {
  let attempts = 0;
  const maxAttempts = 10;
  const interval = setInterval(() => {
    attempts++;
    if (createEditor && createEditor.executeMethod) {
      createEditor.executeMethod(
        'SetTrackRevisions',
        [{ value: true, userAll: true }],
        (error, result) => {
          console.log('Track Changes command result:', { error, result });
        }
      );
      clearInterval(interval);
    } else if (attempts >= maxAttempts) {
      clearInterval(interval);
    }
  }, 300);

This ensures Track Changes is **enforced programmatically**, not just suggested via the config.

---


I include the full config (including the `trackChanges` setting and user info) in a JWT for secure ONLYOFFICE initialization:
const token = jwt.sign(config, jwtSecret);
config.token = token;
this is the approach I used but this approach is not working as the document opens with track changes as " OFF for me and everyone " .

Hello @vansh,
The “On for me and everyone” option cannot be enabled via the API, as it is a document-specific property that cannot be modified through the editor initialization config. It can only be set at the level of document templates.

However, if you need to restrict all users to only review the document without directly editing it, you can achieve this by using the “edit”: false and “review”: true permission combination.