Skip to content

Persistence

HyperToken persists the current Automerge Chronicle through a StorageAdapter. The public flow is:

engine.useStorage(adapter);
await engine.persist("save-name", "optional description");
await engine.resume("save-name");

The stored payload is a base64-encoded Automerge document. Metadata includes the save name, timestamp, storage version, optional description, and byte size. listSaves() returns metadata newest first; deleteSave() removes a named save.

Use MemoryAdapter for tests, FilesystemAdapter in Node.js, and IndexedDBAdapter in browser applications. Persistence is separate from network sync: load, restore, and compaction require no active network/sync attachment.