Skip to content

firstEnv

firstEnv(env, names, fallback): string

Defined in: first-env.ts:11

Return the value of the first variable in names that is set and non-empty, or fallback when none is. Use it for a precedence chain such as a product-specific name, then the vendor-native name, then a default.

EnvLookup

readonly string[]

string

string

const dsn = firstEnv(env, ["HOLOCRON_SENTRY_DSN", "SENTRY_DSN"], DEFAULT_DSN);

firstEnv(env, names, fallback?): string | undefined

Defined in: first-env.ts:12

Return the value of the first variable in names that is set and non-empty, or fallback when none is. Use it for a precedence chain such as a product-specific name, then the vendor-native name, then a default.

EnvLookup

readonly string[]

string

string | undefined

const dsn = firstEnv(env, ["HOLOCRON_SENTRY_DSN", "SENTRY_DSN"], DEFAULT_DSN);