---
title: "Autosaving PDF forms using JavaScript | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/forms/submit-or-save/auto-save/"
md_url: "https://www.nutrient.io/guides/web/forms/submit-or-save/auto-save.md"
last_updated: "2026-06-09T10:25:14.536Z"
description: "Nutrient Web SDK supports autosaving changes made to form fields and form field values. Autosaving behavior is dependent on the operational mode used."
---

# Autosaving changes made to PDF forms

Nutrient Web SDK supports autosaving changes made to form fields and form field values. Autosaving behavior is dependent on the [operational mode](https://www.nutrient.io/guides/web/about/operational-modes.md) used and the configuration of [`Configuration#autoSaveMode`](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html#autoSaveMode).

## Standalone

In [standalone mode](https://www.nutrient.io/guides/web/about/operational-modes.md) of Nutrient Web SDK, changes will be stored in memory until they’re exported. The same persisting steps are traversed, which means we still differentiate between saved and unsaved changes, and exported Instant JSON will only contain changes that were saved. See the guide on [importing and exporting](https://www.nutrient.io/guides/web/importing-exporting/instant-json.md) for more information.

## Server-backed

When using the Nutrient Web SDK server-backed [operational mode](https://www.nutrient.io/guides/web/about/operational-modes.md), local changes are always synced to the Document Engine backend by default. This means you can always use the [backend API](https://www.nutrient.io/api/reference/document-engine/upstream/) to interact with these objects. This auto-save behavior can be set by the [`Configuration#autoSaveMode`](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html#autoSaveMode) configuration option.

Before the change is sent to Document Engine, we assign a stable ID ([ULID](https://github.com/alizain/ulid/)). This ID is also used by Document Engine, and it allows you to track updates that happen before Document Engine responds. If you’d like to ensure a local change has been saved by Document Engine, you can use the [`Instance#ensureChangesSaved`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#ensureChangesSaved) method:

```js

NutrientViewer.load(configuration).then(async (instance) => {
	const createdAnnotations = await instance.create(newAnnotation);
	const [savedAnnotation] = await instance.ensureChangesSaved(
		createdAnnotations
	);
	console.log(savedAnnotation.id);
});

```

## Configuration#autoSaveMode

If nothing else is configured, Nutrient Web SDK will have auto save enabled. This means that local changes are automatically synced. You can use [`Configuration#autoSaveMode`](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html#autoSaveMode) to configure exactly when saving occurs.

| Save mode                                     | Use case                                                                                                                                                                                   |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| _default_                                     | If [`Configuration#instant`](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html#instant) is `true`, `autoSaveMode` defaults to [`NutrientViewer.AutoSaveMode.IMMEDIATE`](https://www.nutrient.io/api/web/NutrientViewer.html#.AutoSaveMode). Otherwise, it defaults to [`NutrientViewer.AutoSaveMode.INTELLIGENT`](https://www.nutrient.io/api/web/NutrientViewer.html#.AutoSaveMode). |

| [`NutrientViewer.AutoSaveMode.IMMEDIATE`](https://www.nutrient.io/api/web/NutrientViewer.html#.AutoSaveMode)   | Changes are saved whenever something changes, as long as they’re in a valid state. This is useful for real-time updates but increases server load.                                         |
| [`NutrientViewer.AutoSaveMode.INTELLIGENT`](https://www.nutrient.io/api/web/NutrientViewer.html#.AutoSaveMode) | Changes are saved whenever we detect a complete operation. This merges multiple operations into one server request and saves, for example, on deselect.                                    |
| [`NutrientViewer.AutoSaveMode.DISABLED`](https://www.nutrient.io/api/web/NutrientViewer.html#.AutoSaveMode)    | Changes aren’t saved by default. You can use [`Instance#save`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#save) to trigger a save manually whenever you want.                                                                             |

Here’s an example of how to set the `autoSaveMode` in the configuration object passed to [`NutrientViewer.load()`]:

```js

NutrientViewer.load({ autoSaveMode: NutrientViewer.AutoSaveMode.INTELLIGENT });

```
---

## Related pages

- [Embed data into PDF forms using JavaScript](/guides/web/forms/submit-or-save/embed-data-into-pdf.md)
- [Submit and save PDF forms to an external source](/guides/web/forms/form-submission.md)
- [Submit and save PDF forms using Document Engine](/guides/web/forms/submit-or-save/to-server-backed.md)

