API reference@evolu/commonlocal‑first/Owner › DeviceAppOwner

Defined in: packages/common/src/local-first/Owner.ts:477

An AppOwner for encrypting device-only data.

Device-only data belongs to the current device rather than to the synced app identity. A common example is the last used AppOwner, which can be stored so users do not need to enter the mnemonic every time they reopen the app.

This data must be encrypted because other OS processes may be able to read unencrypted app-controlled storage such as localStorage, IndexedDB, or similar stores.

DeviceAppOwner is backed by a platform-specific secure primitive such as Expo SecureStore, Electron safeStorage, or WebAuthn PRF.

Use DeviceAppOwner with a local-only Evolu instance. Local-only means an Evolu instance with empty transports (transports: []) so it does not sync its AppOwner, and local-only (prefixed with "_") tables.

A local-only Evolu instance is better than plain platform storage because device-only data gets schema, reactivity, and the same cross-platform behavior as the rest of Evolu.

The local-only Evolu instance can still use other owners for sync via useOwner. Use it for data that belongs to the current device rather than the user app Evolu instance (news delivery etc.).

DeviceAppOwner Evolu instance is secure only when its data stays on the device.

Extends

Properties

encryptionKey

readonly encryptionKey: Uint8Array<ArrayBufferLike> & Brand<"Entropy"> & Brand<"Length32"> & Brand<"EncryptionKey"> & Brand<"OwnerEncryptionKey">;

Defined in: packages/common/src/local-first/Owner.ts:41

TODO: Wrap with Redacted in the next major version.

Inherited from

AppOwner.encryptionKey


id

readonly id: string & Brand<"Id"> & Brand<"OwnerId">;

Defined in: packages/common/src/local-first/Owner.ts:39

Inherited from

AppOwner.id


mnemonic

readonly mnemonic: string & Brand<"Trimmed"> & Brand<"MinLength1"> & Brand<"Mnemonic">;

Defined in: packages/common/src/local-first/Owner.ts:219

The mnemonic that was used to derive the AppOwner keys. Optional when the AppOwner is created from external keys to avoid sharing the mnemonic with the Evolu app.

TODO: Wrap with Redacted in the next major version.

Inherited from

AppOwner.mnemonic


source

readonly source: "ExpoSecureStore" | "WebAuthnPrf" | "ElectronSafeStorage";

Defined in: packages/common/src/local-first/Owner.ts:478


type

readonly type: "AppOwner";

Defined in: packages/common/src/Type.ts:3492

Inherited from

AppOwner.type


writeKey

readonly writeKey: Uint8Array<ArrayBufferLike> & Brand<"Entropy"> & Brand<"Length16"> & Brand<"OwnerWriteKey">;

Defined in: packages/common/src/local-first/Owner.ts:77

TODO: Wrap with Redacted in the next major version.

Inherited from

AppOwner.writeKey