@maverickcer/env-cap
    Preparing search index...

    Function createEnv

    • Declares a feature's environment contract. Colocate this call with the feature that consumes the variables (e.g. features/payments/env.schema.ts).

      Type Parameters

      Parameters

      Returns EnvContract<S>

      An EnvContract exposing one read-only getter per key -- there is no global env object, only per-feature contracts like paymentsEnv.STRIPE_KEY. Accessing a key throws until validateEnv has run successfully for the runtime this contract was passed to.

      createEnv is runtime-only: processor/validator/default are the whole vocabulary, because they're the only fields validateEnv actually reads. Documentation -- description, ownership, lifecycle, category, and everything else that only exists to generate docs -- lives in a separate documentEnv call (see document.ts), which is entirely optional and never required for this to work.