API reference / @evolu/common / Evolu/Owner / AppOwner
Interface: AppOwner
Defined in: packages/common/src/Evolu/Owner.ts:159
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.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
encryptionKey | readonly | Uint8Array<ArrayBufferLike> & Brand<"Entropy"> & Brand<"Length32"> & Brand<"EncryptionKey"> & Brand<"OwnerEncryptionKey"> | - | Owner.encryptionKey | packages/common/src/Evolu/Owner.ts:75 |
id | readonly | string & Brand<"Id"> & Brand<"OwnerId"> | - | Owner.id | packages/common/src/Evolu/Owner.ts:74 |
mnemonic? | readonly | | string & Brand<"Trimmed"> & Brand<"MinLength1"> & Brand<"Mnemonic"> | null | 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. | - | packages/common/src/Evolu/Owner.ts:167 |
type | readonly | "AppOwner" | - | - | packages/common/src/Evolu/Owner.ts:160 |
writeKey | readonly | Uint8Array<ArrayBufferLike> & Brand<"Entropy"> & Brand<"Length16"> & Brand<"OwnerWriteKey"> | - | Owner.writeKey | packages/common/src/Evolu/Owner.ts:76 |