API reference › @evolu/common › local‑first/Owner
Owner identity and cryptographic key derivation.
Functions
| Function | Description |
|---|---|
| createAppOwner | Creates an AppOwner from an OwnerSecret. |
| createOwnerSecret | Creates a OwnerSecret. |
| createOwnerWebSocketTransport | Creates an OwnerWebSocketTransport for the given relay URL and OwnerId. |
| createOwnerWriteKey | Creates a new random OwnerWriteKey for rotation. |
| createShardOwner | Creates a ShardOwner from an OwnerSecret. |
| createSharedOwner | Creates a SharedOwner from an OwnerSecret for collaborative write access. |
| createSharedReadonlyOwner | Creates a SharedReadonlyOwner from a SharedOwner. |
| deriveShardOwner | Derives a ShardOwner from an AppOwner using the specified path. |
| mnemonicToOwnerSecret | Converts a Mnemonic to an OwnerSecret. |
| ownerIdBytesToOwnerId | Converts OwnerIdBytes to OwnerId. |
| ownerIdToOwnerIdBytes | Converts OwnerId to OwnerIdBytes. |
| ownerSecretToMnemonic | Converts an OwnerSecret to a Mnemonic. |
| parseOwnerIdFromOwnerWebSocketTransportUrl | Extracts OwnerId from an OwnerWebSocketTransport URL query string. |
Interfaces
| Interface | Description |
|---|---|
| AppOwner | 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. |
| DeviceAppOwner | An AppOwner for encrypting device-only data. |
| Owner | The Owner represents ownership of data in Evolu. Every database change is assigned to an owner and encrypted with its OwnerEncryptionKey. Owners allow partial sync, only the AppOwner is synced by default. |
| OwnerError | Common interface implemented by all owner domain errors. |
| OwnerUsage | Usage data for an OwnerId. |
| OwnerWebSocketTransport | WebSocket transport configuration. |
| ReadonlyOwner | Owner without a OwnerWriteKey. |
| ShardOwner | An Owner for sharding data. |
| SharedOwner | An Owner for collaborative data with write access. |
| SharedReadonlyOwner | Read-only version of a SharedOwner for data sharing. Contains only the OwnerId and EncryptionKey needed for others to read the shared data without write access. |
| SyncOwner | An ReadonlyOwner or Owner with non-empty OwnerTransports so it can be synced. |
Type Aliases
| Type Alias | Description |
|---|---|
| OwnerEncryptionKey | Symmetric encryption key for Owner data protection. |
| OwnerId | OwnerId is a branded Id that uniquely identifies an Owner. |
| OwnerIdBytes | Bytes representation of OwnerId. |
| OwnerSecret | 32 bytes of cryptographic entropy used to derive Owner keys. |
| OwnerTransport | Transport configuration for connecting to relays. |
| OwnerWriteKey | A secure token for write operations. It's derived from OwnerSecret by default and can be rotated via createOwnerWriteKey. |
Variables
| Variable | Description |
|---|---|
| OwnerEncryptionKey | Symmetric encryption key for Owner data protection. |
| OwnerId | OwnerId is a branded Id that uniquely identifies an Owner. |
| OwnerIdBytes | Bytes representation of OwnerId. |
| OwnerSecret | 32 bytes of cryptographic entropy used to derive Owner keys. |
| OwnerWriteKey | A secure token for write operations. It's derived from OwnerSecret by default and can be rotated via createOwnerWriteKey. |
| ownerWriteKeyLength | - |
| testAppOwner | Deterministic AppOwner for tests. |
| testOwnerSecret | Deterministic OwnerSecret for tests. |