Skip to main content

Persistence

Overview

By default, Kritzel uses an empty sync provider list (providers: []), so canvas state is reset on page reload. To persist data locally in the browser, configure syncConfig with IndexedDBSyncProvider.

IndexedDB persistence is ideal when you want users to keep their canvas state across reloads and browser restarts on the same device.

Persisting Canvas State with IndexedDB

Configure IndexedDBSyncProvider in the providers array to make object state durable in the browser.

  • Sync configuration ([syncConfig], KritzelSyncConfig)
  • Local persistence provider (IndexedDBSyncProvider)
  • Provider composition (providers array)

For a comprehensive view, see the API Reference.