Skip to main content

getConfig

steamharness.getConfig<T extends ConfigurationValue = ConfigurationValue>(key: string): T | undefined

Returns a value from the current execution configuration without string conversion or trimming. Supported values include strings, numbers, booleans, arrays, objects and null. Missing keys and calls outside an execution scope return undefined. The generic type is a caller assertion; declarations and writes validate actual values. Nested values are frozen. context.config exposes the same values in executor, resolver and node contexts.

Only own configuration keys are read. Names such as toString return a value only when explicitly configured and are subject to required-field validation.

const enabled = steamharness.getConfig<boolean>("enabled") ?? false;
const token = steamharness.getConfig<string>("API_KEY");

This API replaces business getEnv; it never reads process variables or project env files. See Project configurations for declarations, storage, snapshots and import/export.