Rxdb
Interfaces
Interfaces
StorageConfig
Storage configuration
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
type | StorageType | undefined | No | Storage type (auto-detected if not specified) |
options | Record<string, any> | undefined | No | Storage-specific options (e.g., batchSize for IndexedDB) |
custom | RxStorage<any, any> | undefined | No | Custom RxStorage instance |
PluginConfig
Plugin configuration
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
devMode | boolean | undefined | No | Enable dev mode plugin (dev only) |
queryBuilder | boolean | undefined | No | Enable query builder plugin |
update | boolean | undefined | No | Enable update plugin |
migration | boolean | undefined | No | Enable migration schema plugin |
leaderElection | boolean | undefined | No | Enable leader election plugin |
encryption | boolean | undefined | No | Enable encryption plugin (requires encryption key) |
custom | RxPlugin[] | undefined | No | Custom plugins to add |
EncryptionConfig
Encryption configuration
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Enable encryption |
key | string | undefined | No | Encryption key (32-byte base64 encoded string) |
| If not provided, will try to read from RXDB_ENCRYPTION_KEY env var |
RxDBConfig
Main RxDB configuration
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Database name |
collections | RxCollections | Yes | Collection definitions |
preset | RxDBPreset | undefined | No | Preset configuration (ignored if plugins specified) |
storage | StorageConfig | undefined | No | Storage configuration |
plugins | PluginConfig | undefined | No | Plugin configuration |
premium | boolean | undefined | No | Enable RxDB premium features |
closeDuplicates | boolean | undefined | No | Auto-close duplicate databases (useful for hot reload in development) |
encryption | EncryptionConfig | undefined | No | Encryption configuration |