API reference › @evolu/common › local‑first/Evolu › DevicePersistenceDep

Defined in: packages/common/src/local-first/Evolu.ts:1753

Tells what the platform can promise about the databases it stores.

createEvoluDeps asks it once and gives every instance without EvoluConfig.memoryOnly the same answer. NotPersisted means the platform offers no persistent storage now, as a browser does in Safari's Private Browsing or a Firefox private window, so the instance keeps its database in memory, under the random per-instance name memoryOnly gives it. A platform that cannot tell a private session from a storage failure answers NotPersisted for both: memory loses nothing that refusing to start would have kept, and the stored database stays untouched.

A later storage failure is reported through the normal error path; it never silently changes an instance from stored to memory. Its answer stays the same for the deps' lifetime, as createEvoluDeps' does, which asks the platform once, so code that asks it again, such as an unlock after a start that asked, gets the answer it started with.

Properties

getDevicePersistence

readonly getDevicePersistence: () => Promise<DevicePersistence>;

Defined in: packages/common/src/local-first/Evolu.ts:1754