API reference / @evolu/common / Evolu/Internal / EvoluConfig
Interface: EvoluConfig
Defined in: packages/common/src/Evolu/Evolu.ts:64
Extends
Partial<DbConfig>
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
enableLogging? | readonly | boolean | Enable or disable console logging (default: false). When true, logs are output to the Console; when false, logging is disabled for all methods except error, which always outputs to ensure critical issues are not missed. | ConsoleConfig.enableLogging | packages/common/src/Console.ts:105 |
encryptionKey? | readonly | Uint8Array<ArrayBufferLike> & Brand<"Entropy"> & Brand<"Length32"> & Brand<"EncryptionKey"> | Experimental Encryption key for the SQLite database. | DbConfig.encryptionKey | packages/common/src/Evolu/Db.ts:202 |
externalAppOwner? | readonly | AppOwner | External AppOwner to use when creating Evolu instance. Use this when you want to manage AppOwner creation and persistence externally (e.g., with your own authentication system). If omitted, Evolu will automatically create and persist an AppOwner locally. For device-specific settings and account management state, we can use a separate local-only Evolu instance via transports: []. ### Example const ConfigId = id("Config"); type ConfigId = typeof ConfigId.Type; const DeviceSchema = { config: { id: ConfigId, key: NonEmptyString50, value: NonEmptyString50, }, }; // Local-only instance for device settings (no sync) const deviceEvolu = createEvolu(evoluReactWebDeps)(DeviceSchema, { name: SimpleName.orThrow("MyApp-Device"), transports: [], // No sync - stays local to device }); // Main synced instance for user data const evolu = createEvolu(evoluReactWebDeps)(MainSchema, { name: SimpleName.orThrow("MyApp"), // Default transports for sync }); | DbConfig.externalAppOwner | packages/common/src/Evolu/Db.ts:184 |
indexes? | readonly | IndexesConfig | Use the indexes option to define SQLite indexes. Table and column names are not typed because Kysely doesn't support it. https://medium.com/@JasonWyatt/squeezing-performance-from-sqlite-indexes-indexes-c4e175f3c346 ### Example const evolu = createEvolu(evoluReactDeps)(Schema, { indexes: (create) => [ create("todoCreatedAt").on("todo").column("createdAt"), create("todoCategoryCreatedAt") .on("todoCategory") .column("createdAt"), ], }); | - | packages/common/src/Evolu/Evolu.ts:85 |
inMemory? | readonly | boolean | Use in-memory SQLite database instead of persistent storage. Useful for testing or temporary data that doesn't need persistence. In-memory databases exist only in RAM and are completely destroyed when the process ends, making them forensically safe for sensitive data. The default value is: false. | DbConfig.inMemory | packages/common/src/Evolu/Db.ts:195 |
maxDrift? | readonly | number | Maximum physical clock drift allowed in ms. The default value is 5 _ 60 _ 1000 (5 minutes). | DbConfig.maxDrift | packages/common/src/Evolu/Timestamp.ts:27 |
name? | readonly | string & Brand<"UrlSafeString"> & Brand<"SimpleName"> | The name of the Evolu instance. Evolu is multitenant - it can run multiple instances concurrently. Each instance must have a unique name. The instance name is used as the SQLite database filename for persistent storage, ensuring that database files are separated and invisible to each other. The default value is: Evolu. ### Example // name: SimpleName.orThrow("MyApp") | DbConfig.name | packages/common/src/Evolu/Db.ts:89 |
reloadUrl? | readonly | string | URL to reload browser tabs after reset or restore. The default value is /. | - | packages/common/src/Evolu/Evolu.ts:92 |
transports? | readonly | readonly WebSocketTransportConfig[] | Transport configuration for data sync and backup. Supports single transport or multiple transports simultaneously for redundancy. Redundancy: The ideal setup uses at least two completely independent relays - for example, a home relay and a geographically separate relay. Data is sent to both relays simultaneously, providing true redundancy similar to using two independent clouds. This eliminates vendor lock-in and ensures your app continues working regardless of circumstances - whether home relay hardware is stolen or a remote relay provider shuts down. Currently supports: - WebSocket: Real-time bidirectional communication with relay servers Empty transports create local-only instances. Transports can be dynamically added and removed for any owner (including AppOwner) via Evolu#useOwner. Use createWebSocketTransportConfig to create WebSocket transport configurations with proper URL formatting and OwnerId inclusion. The OwnerId in the URL enables relay authentication, allowing relay servers to control access (e.g., for paid tiers or private instances). The default value is: { type: "WebSocket", url: "wss://free.evoluhq.com" }. ### Example // Single WebSocket relay transports: [{ type: "WebSocket", url: "wss://relay1.example.com" }]; // Multiple WebSocket relays for redundancy transports: [ { type: "WebSocket", url: "wss://relay1.example.com" }, { type: "WebSocket", url: "wss://relay2.example.com" }, { type: "WebSocket", url: "wss://relay3.example.com" }, ]; // Local-only instance (no sync) - useful for device settings or when relay // URL will be provided later (e.g., after authentication), allowing users // to work offline before the app connects transports: []; // Using createWebSocketTransportConfig helper for relay authentication transports: [ createWebSocketTransportConfig({ relayUrl: "ws://localhost:4000", ownerId, }), ]; | DbConfig.transports | packages/common/src/Evolu/Db.ts:146 |