Skip to content

IConfiguardOptions

Defined in: src/types/IConfiguardOptions.ts:7

Options for initializing Configuard.

optional debugLogs?: boolean

Defined in: src/types/IConfiguardOptions.ts:15

Whether to enable debug logs. If set to true, Configuard will log detailed information about the configuration loading and validation process, which can be helpful for troubleshooting.

false

optional lock?: boolean

Defined in: src/types/IConfiguardOptions.ts:23

Whether to deep-freeze the built configuration object so it cannot be mutated at runtime. Recursively freezes nested objects and arrays. Set to false to get a mutable result.

true

optional decrypt?: (value, item) => string

Defined in: src/types/IConfiguardOptions.ts:39

Hook to decrypt the stored value of items marked encrypt: true, applied (before templating and type-parsing) while building the configuration object. Configuard is crypto-agnostic: you supply how to decrypt (your KMS, a symmetric key via Node’s crypto, etc.).

Decryption is opt-in: without this hook, encrypt: true values are used as-is. If the hook throws, a ConfiguardError is thrown. The function must be synchronous.

string

The stored (encrypted) string value.

Readonly<IConfigItem>

A read-only view of the config item (e.g. to vary the key).

string

The decrypted plaintext string.