interface IEnvironmentApi
Since 0.1.0

Environment validation surface: plugins declare the environment variables they need, and the kernel validates them at startup, failing fast on violations.

Methods

validate(spec: Readonly<Record<string, EnvVarSpec>>): void

Declares and validates environment variables.

Call this from IPlugin.register. The kernel validates every declared spec once, after all plugins have registered and before the init hooks run, so a spec declared later (e.g. from an onInit hook) is never checked.

Usage

import { type IEnvironmentApi } from "common/src/index.ts";