StorageOptions
StorageOptions =
object
Defined in: sdks/js/node-sdk/dist/index.d.ts:84
Storage options
Properties
Section titled “Properties”dbEncryptionKey?
Section titled “dbEncryptionKey?”
optionaldbEncryptionKey?:Uint8Array|HexString
Defined in: sdks/js/node-sdk/dist/index.d.ts:112
Encryption key for the local DB (32 bytes, hex)
https://docs.xmtp.org/sdk/client/#view-an-encrypted-database
dbPath?
Section titled “dbPath?”
optionaldbPath?:string|null| ((inboxId) =>string)
Defined in: sdks/js/node-sdk/dist/index.d.ts:106
Path to the local DB
There are 4 value types that can be used to specify the database path:
-
undefined(or excluded from the client options) The database will be created in the current working directory and is based on the environment label and client inbox ID. Example:xmtp-default-<inbox-id>.db3 -
nullNo database will be created and all data will be lost once the client disconnects. -
stringThe given path will be used to create the database. Example:./my-db.db3 -
functionA callback function that receives the inbox ID and returns a string path. Example:(inboxId) => string
maxDbPoolSize?
Section titled “maxDbPoolSize?”
optionalmaxDbPoolSize?:number
Defined in: sdks/js/node-sdk/dist/index.d.ts:118
Maximum number of connections in the local DB connection pool.
Defaults to 25 when unset. Ignored when useSingleConnection is true.
minDbPoolSize?
Section titled “minDbPoolSize?”
optionalminDbPoolSize?:number
Defined in: sdks/js/node-sdk/dist/index.d.ts:124
Minimum number of connections kept warm in the local DB connection pool.
Defaults to 5 when unset. Ignored when useSingleConnection is true.
useSingleConnection?
Section titled “useSingleConnection?”
optionaluseSingleConnection?:boolean
Defined in: sdks/js/node-sdk/dist/index.d.ts:132
When true, the native DB uses a single connection (one file descriptor)
instead of a pool. The pool-size options above are ignored. Intended for
services running many clients in one process.
Defaults to false (pooled).

