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

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

The AppOwner represents the application owner. It's created using a cryptographically secure random generator or derived from an external source, e.g., mnemonic stored securely in a hardware device.

While it's possible to store all application data in AppOwner, the better approach is to use it only for sync coordination. Storing all app data in AppOwner means that data will be stored/synced forever. And that's a problem if we want to provide real data deletion or in-app data migration without data duplication. In local-first apps/distributed systems, we can't delete individual changes, we only mark them as deleted, otherwise sync could not work.

If we really want to delete data or at least avoid syncing it, we must store it using a different owner than AppOwner, e.g. ShardOwner or SharedOwner, and delete that owner. The AppOwner itself must be preserved because it coordinates deletion information across devices. Other devices need to sync the information that an owner was deleted so they can delete their local data as well.

Privacy Considerations

AppOwner must never be shared with anyone.

AppOwner's OwnerId is used for authorization with createOwnerWebSocketTransport. Share it only with trusted relay parties that must verify access, and do not share it with anyone else.

For data sharing scenarios, use SharedOwner and SharedReadonlyOwner to make intent explicit and distinguish collaborative usage from AppOwner coordination.

Extends

Extended by

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

Owner.encryptionKey


id

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

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

Inherited from

Owner.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.


type

readonly type: "AppOwner";

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

Inherited from

Typed.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

Owner.writeKey