Share via


RuntimeConfiguration class

Base configuration class for Agent365 SDK. Other packages extend this to add their own settings.

Override functions are called on each property access, enabling dynamic resolution from async context (e.g., OpenTelemetry baggage) per-request.

Properties

clusterCategory
isDevelopmentEnvironment

Whether the cluster is a development environment (local or dev). Based on clusterCategory.

isNodeEnvDevelopment

Whether NODE_ENV indicates development mode. Returns true when NODE_ENV is 'development' (case-insensitive). This is the standard Node.js way of indicating development mode.

Methods

parseEnvBoolean(undefined | string)

Parse an environment variable as a boolean. Recognizes 'true', '1', 'yes', 'on' (case-insensitive) as true; all other values as false.

parseEnvInt(undefined | string, number)

Parse an environment variable as an integer, returning fallback if invalid or not set.

Constructor Details

RuntimeConfiguration(RuntimeConfigurationOptions)

new RuntimeConfiguration(overrides?: RuntimeConfigurationOptions)

Parameters

Property Details

clusterCategory

ClusterCategory clusterCategory

Property Value

isDevelopmentEnvironment

Whether the cluster is a development environment (local or dev). Based on clusterCategory.

boolean isDevelopmentEnvironment

Property Value

boolean

isNodeEnvDevelopment

Whether NODE_ENV indicates development mode. Returns true when NODE_ENV is 'development' (case-insensitive). This is the standard Node.js way of indicating development mode.

boolean isNodeEnvDevelopment

Property Value

boolean

Method Details

parseEnvBoolean(undefined | string)

Parse an environment variable as a boolean. Recognizes 'true', '1', 'yes', 'on' (case-insensitive) as true; all other values as false.

static function parseEnvBoolean(envValue: undefined | string): boolean

Parameters

envValue

undefined | string

Returns

boolean

parseEnvInt(undefined | string, number)

Parse an environment variable as an integer, returning fallback if invalid or not set.

static function parseEnvInt(envValue: undefined | string, fallback: number): number

Parameters

envValue

undefined | string

fallback

number

Returns

number