LoadConfigOptions
Type Alias: LoadConfigOptions<T>
Section titled “Type Alias: LoadConfigOptions<T>”LoadConfigOptions<
T> =object
Defined in: types.ts:110
Configuration for loadConfig.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”includeValuesInErrors?
Section titled “includeValuesInErrors?”
optionalincludeValuesInErrors?:boolean
Defined in: types.ts:123
If true, the validation error message includes the values that failed, and ValidationErrorContext.merged is passed to LoadConfigOptions.onValidationError. Off by default to avoid logging secrets.
logger?
Section titled “logger?”
optionallogger?:ConfigLogger
Defined in: types.ts:116
Optional logger for diagnostics.
optionalmode?:ValidationMode
Defined in: types.ts:128
Validation failure behaviour. Defaults to "strict" (throw). See
ValidationMode.
onSourceError?
Section titled “onSourceError?”
optionalonSourceError?: (error,info) =>void
Defined in: types.ts:145
Diagnostic hook called when a source’s load() throws. The error is
still soft-handled (treated as an empty source) so other sources
continue to load — this hook is purely for observability.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
onValidationError?
Section titled “onValidationError?”
optionalonValidationError?: (error,context) =>Error|void
Defined in: types.ts:139
Hook called with the raw validation error before config-kit decides what to do with it. Use it to inspect Zod issues, attach the config file path, or render a custom message.
Return an Error to use it instead of config-kit’s default (redacted)
error — that Error is thrown in strict mode or logged in warn mode.
Return nothing to keep the default behaviour.
Parameters
Section titled “Parameters”unknown
context
Section titled “context”Returns
Section titled “Returns”Error | void
schema
Section titled “schema”schema:
Schema<T>
Defined in: types.ts:112
Schema used to validate and shape the merged config.
sources
Section titled “sources”sources:
AnyConfigSource[]
Defined in: types.ts:114
Sources merged in order. Later sources override earlier.