API reference@evolu/common › local‑first/Owner

Owner identity and cryptographic key derivation.

Functions

FunctionDescription
createAppOwnerCreates an AppOwner from an OwnerSecret.
createOwnerSecretCreates a OwnerSecret.
createOwnerWebSocketTransportCreates an OwnerWebSocketTransport for the given relay URL and OwnerId.
createOwnerWriteKeyCreates a new random OwnerWriteKey for rotation.
createShardOwnerCreates a ShardOwner from an OwnerSecret.
createSharedOwnerCreates a SharedOwner from an OwnerSecret for collaborative write access.
createSharedReadonlyOwnerCreates a SharedReadonlyOwner from a SharedOwner.
deriveShardOwnerDerives a ShardOwner from an AppOwner using the specified path.
mnemonicToOwnerSecretConverts a Mnemonic to an OwnerSecret.
ownerIdBytesToOwnerIdConverts OwnerIdBytes to OwnerId.
ownerIdToOwnerIdBytesConverts OwnerId to OwnerIdBytes.
ownerSecretToMnemonicConverts an OwnerSecret to a Mnemonic.
parseOwnerIdFromOwnerWebSocketTransportUrlExtracts OwnerId from an OwnerWebSocketTransport URL query string.

Interfaces

InterfaceDescription
AppOwnerThe 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.
DeviceAppOwnerAn AppOwner for encrypting device-only data.
OwnerThe 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.
OwnerErrorCommon interface implemented by all owner domain errors.
OwnerUsageUsage data for an OwnerId.
OwnerWebSocketTransportWebSocket transport configuration.
ReadonlyOwnerOwner without a OwnerWriteKey.
ShardOwnerAn Owner for sharding data.
SharedOwnerAn Owner for collaborative data with write access.
SharedReadonlyOwnerRead-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.
SyncOwnerAn ReadonlyOwner or Owner with non-empty OwnerTransports so it can be synced.

Type Aliases

Type AliasDescription
OwnerEncryptionKeySymmetric encryption key for Owner data protection.
OwnerIdOwnerId is a branded Id that uniquely identifies an Owner.
OwnerIdBytesBytes representation of OwnerId.
OwnerSecret32 bytes of cryptographic entropy used to derive Owner keys.
OwnerTransportTransport configuration for connecting to relays.
OwnerWriteKeyA secure token for write operations. It's derived from OwnerSecret by default and can be rotated via createOwnerWriteKey.

Variables

VariableDescription
OwnerEncryptionKeySymmetric encryption key for Owner data protection.
OwnerIdOwnerId is a branded Id that uniquely identifies an Owner.
OwnerIdBytesBytes representation of OwnerId.
OwnerSecret32 bytes of cryptographic entropy used to derive Owner keys.
OwnerWriteKeyA secure token for write operations. It's derived from OwnerSecret by default and can be rotated via createOwnerWriteKey.
ownerWriteKeyLength-
testAppOwnerDeterministic AppOwner for tests.
testOwnerSecretDeterministic OwnerSecret for tests.