stable
Configuration
The full createNoydb reference: every non-strategy option key you pass to createNoydb(), grouped into detailed tables by concern.
The core options below cover every non-strategy key you pass to createNoydb(options). The with*() slots that unlock capabilities beyond the always-on kernel are the strategies — a separate directory: see Strategies.
Core options
Every non-strategy key on the options object passed to createNoydb(options). Strategy slots (historyStrategy, syncStrategy, and the rest) are covered on the Strategies page instead.
Identity and keys
| Key | Type | Default | Meaning |
|---|---|---|---|
user | string | — (required) | The user identifier for this session. |
secret | string | — | Secret for key derivation. Required unless encrypt: false or getKeyring is supplied; supplying both secret and getKeyring throws. |
getKeyring | (vault: string) => Promise<UnlockedKeyring> | — | Callback that returns an unlocked keyring, for WebAuthn / OIDC / Shamir / any unlock that supplies the keyring directly rather than deriving it from a secret. Called lazily on first use per vault and cached per (instance, vault). Mutually exclusive with secret. |
secretMode | 'standard' | 'managed' | 'standard' | 'standard' uses secret as the plaintext secret; 'managed' generates a random 256-bit secret sealed under sealingKey (rubber-hose-resistant — the user never sees it). 'managed' is mutually exclusive with secret and getKeyring. |
sealingKey | NoydbSealer | — | Seals / unseals the auto-generated managed-mode secret. Required when secretMode === 'managed', ignored otherwise. |
shamirRecovery | NoydbShamir | — | Required to use the 'shamir' recovery profile. |
auth | 'secret' | 'biometric' | 'secret' | Auth method. |
Encryption
| Key | Type | Default | Meaning |
|---|---|---|---|
encrypt | boolean | true | Enable encryption. false stores raw JSON — testing/debugging only. |
debugPlaintext | boolean | false | Lay plaintext records out as directly-inspectable store objects (fields inlined, _debug: 1). Requires encrypt: false — combined with encryption it throws DebugPlaintextError at construction. Never enable for production or client data. See Enclave → Debug-plaintext layout. |
objectStore | ObjectProjection | — | Object projection for external blob fields — routes raw bytes to a servable native object. Sees plaintext bytes, so it sits outside the zero-knowledge guarantee. |
Storage
| Key | Type | Default | Meaning |
|---|---|---|---|
store | NoydbStore | built-in toMemory() (non-persistent) | The ciphertext store — where encrypted envelopes are persisted. Without it, nothing survives the session. See Stores. |
Conflict and sync scheduling
| Key | Type | Default | Meaning |
|---|---|---|---|
conflict | ConflictStrategy | 'version' | Conflict-resolution strategy for concurrent writes. |
sync | NoydbStore | SyncTarget | SyncTarget[] | — | Remote store target(s) for replication. Configuring this needs the sync service (see Strategies). |
syncPolicy | SyncPolicy | — (a store-category policy is resolved, but resolving one does not start automation) | Push/pull scheduling. Automation runs only when you declare this option (or a per-target policy) — passing sync: alone gives you explicit db.push() / db.pull() / db.sync() and nothing else. See sync → the automation ladder. |
autoSync | boolean | — | Deprecated — use syncPolicy (which wins when both are set). |
syncInterval | number | — | Deprecated — use syncPolicy. |
Session lifetime
| Key | Type | Default | Meaning |
|---|---|---|---|
sessionTimeout | number (ms) | none | Deprecated — clears keys after inactivity; use sessionPolicy.idleTimeoutMs. Still honored, but sessionPolicy wins. |
sessionPolicy | SessionPolicy | — | Session lifetime, re-auth requirements, and background-lock behavior. Enforcement needs the session service (see Strategies); replaces the legacy sessionTimeout. |
Validation, policy, and recovery
| Key | Type | Default | Meaning |
|---|---|---|---|
validateSecret | boolean | false | Validate secret strength on first-time keyring creation; weak phrases throw WeakSecretError. |
policy | VaultPolicy | PERSONAL_POLICY | Vault-level policy-gate document, persisted to _meta/policy on first-time creation and honored only at creation thereafter (change it later with updatePolicy). Use STRICT_POLICY for regulated deployments. |
recovery | readonly RecoveryEnrollment[] | — | Recovery profiles to enroll. 'paper' is supported end-to-end; other profiles ship the API shape and throw RecoveryProfileNotImplementedError in use. |
requireRecovery | boolean | false | When true, createNoydb rejects a vault with no recovery entries persisted (throws RecoveryNotEnrolledError). Turn on for regulated environments. |
onInvalidKey | 'error' | 'reset' | 'error' | What to do when an existing keyring can't be decrypted with the supplied credentials. 'error' propagates InvalidKeyError; 'reset' deletes the stale keyring and re-initializes from scratch — all previously encrypted data becomes unrecoverable. Secret path only. |
Public envelope, history, and translation
| Key | Type | Default | Meaning |
|---|---|---|---|
cover | true | CoverSchema | off | Enable the cover service — the owner-curated plaintext vault label. See cover. |
history | HistoryConfig | — | Audit-history configuration (enabled, maxVersions, per-collection ledger participation). |
plaintextTranslator | PlaintextTranslatorFn | — | Consumer-supplied translation function for i18nText fields marked autoTranslate: true. Receives unencrypted text — configuring it lets plaintext leave the zero-knowledge boundary over whatever channel your implementation uses. Calling put() on an autoTranslate field without it throws TranslatorNotConfiguredError. |
plaintextTranslatorName | string | 'anonymous' | Human-readable translator name recorded in the audit log (e.g. 'deepl-pro-with-dpa'). |
Internal / advanced
A handful of keys exist only so createNoydb() can thread pre-resolved values into the constructor; they are @internal with no supported override, and applications should not set them.
| Key | Meaning |
|---|---|
coordinationStrategy | Drain-barrier coordination transport for the schema fence. Provider injection, not a with*() service — note the name doesn't follow the strategy pattern. Defaults to a store-backed provider that reproduces today's store-polling fence; real-time transports inject a push provider here. |
sessionId | Stable id for the session that owns this instance's writers; defaults to a fresh ULID per instance. |
userApiFactory · policyFactory · policyCheckGateFn | Pre-resolved factories/functions for the vault.user API and the policy engine, always resolved by createNoydb() itself. No supported override. |
See also
- Strategies — the
with*()service-strategy slots you also pass tocreateNoydb(): all 32, grouped by where the methods they unlock land (client / vault / collection), each linked to its service page.