Connectum API Reference / @connectum/core / parseEnvConfig
Function: parseEnvConfig() ​
parseEnvConfig(
env?):object
Defined in: packages/core/src/config/envSchema.ts:145
Parse and validate environment configuration
Parameters ​
env? ​
Record<string, string | undefined> = process.env
Returns ​
GRACEFUL_SHUTDOWN_ENABLED ​
GRACEFUL_SHUTDOWN_ENABLED:
boolean
Enable graceful shutdown
Default ​
trueGRACEFUL_SHUTDOWN_TIMEOUT_MS ​
GRACEFUL_SHUTDOWN_TIMEOUT_MS:
number
Graceful shutdown timeout in milliseconds
Default ​
30000HTTP_HEALTH_ENABLED ​
HTTP_HEALTH_ENABLED:
boolean=BooleanFromStringSchema
Enable HTTP health endpoints (/healthz, /readyz) When disabled, only gRPC healthcheck is available
Default ​
falseHTTP_HEALTH_PATH ​
HTTP_HEALTH_PATH:
string
HTTP health endpoint path
Default ​
'/healthz'LISTEN ​
LISTEN:
string
Listen address
Default ​
'0.0.0.0'LOG_BACKEND ​
LOG_BACKEND:
"console"|"otel"|"pino"=LoggerBackendSchema
Logger backend
Default ​
'otel'LOG_FORMAT ​
LOG_FORMAT:
"json"|"pretty"=LogFormatSchema
Log format (json for production, pretty for development)
Default ​
'json'LOG_LEVEL ​
LOG_LEVEL:
"error"|"warn"|"debug"|"info"=LogLevelSchema
Log level
Default ​
'info'NODE_ENV ​
NODE_ENV:
"test"|"production"|"development"=NodeEnvSchema
Node environment
Default ​
'development'OTEL_EXPORTER_OTLP_ENDPOINT? ​
optionalOTEL_EXPORTER_OTLP_ENDPOINT?:string
OpenTelemetry exporter endpoint
OTEL_SERVICE_NAME? ​
optionalOTEL_SERVICE_NAME?:string
Optional OpenTelemetry service name. The core parser leaves it undefined when absent; provider defaults belong to the telemetry package.
PORT ​
PORT:
number
Server port
Default ​
5000Example ​
const config = parseEnvConfig();
// or with custom env
const config = parseEnvConfig({ PORT: '8080' });