interface EnvConfigProviderOptions<T = unknown> {
    schema?: ConfigSchema<T>;
    cache?: boolean;
    cacheTTL?: number;
    prefix?: string;
    watch?: boolean;
    transformers?: Record<string, (value: string) => unknown>;
    loadDotenv?: boolean;
    dotenvPath?: string;
    autoTransform?: boolean;
    env?: Record<string, undefined | string>;
}

Type Parameters

  • T = unknown

Hierarchy

  • ConfigProviderOptions<T>
    • EnvConfigProviderOptions

Properties

schema?: ConfigSchema<T>

Validation schema (optional)

cache?: boolean

Cache configuration values

true
cacheTTL?: number

Cache TTL in milliseconds

undefined (no expiration)
prefix?: string

Prefix for all keys

watch?: boolean

Enable hot reload (if supported)

false
transformers?: Record<string, (value: string) => unknown>

Transformation functions for specific keys

{
transformers: {
'port': (value) => parseInt(value, 10),
'timeout': (value) => parseInt(value, 10),
}
}
loadDotenv?: boolean

Load .env file

true
dotenvPath?: string

Path to .env file

'.env'
autoTransform?: boolean

Enable auto-transformation of values (string -> number, boolean, etc.)

true
env?: Record<string, undefined | string>

Environment object to read from

process.env