Disabling automatic synchronization in Nutrient Web SDK
When using Instant, you might need to disable automatic synchronization with Document Engine. To achieve this, configure the NutrientViewer.Configuration
object before passing it to NutrientViewer.load()
, as shown in the following example:
NutrientViewer.load({ // ...other options instant: { clientsPresenceEnabled: false, listenToServerChangesEnabled: false }, autoSaveMode: NutrientViewer.AutoSaveMode.DISABLED});
Detailed implementation
Use the following code snippet to disable automatic synchronization, prevent Instant from tracking client presence, and disable automatic local saving:
return NutrientViewer.load({ instant: { // Don't pull changes from Document Engine automatically. listenToServerChangesEnabled: false, // Disable clients presence tracking. `instance.connectedClients` // method and `instant.connectedClients.change` event won't be available. clientsPresenceEnabled: false }, // Disable automatic saving of local changes. autoSaveMode: NutrientViewer.AutoSaveMode.DISABLED, ...})
return NutrientViewer.load({ instant: { // Don't pull changes from Document Engine automatically. listenToServerChangesEnabled: false, // Disable clients presence tracking. `instance.connectedClients` // method and `instant.connectedClients.change` event won't be available. clientsPresenceEnabled: false }, // Disable automatic saving of local changes. autoSaveMode: NutrientViewer.AutoSaveMode.DISABLED, ...})
Manually syncing changes
Once you disable automatic synchronization, use NutrientViewer.Instance#save
to sync changes manually whenever needed.
For more information, refer to our guides on automatic and manual syncing and listening for client updates.