Beignet API reference
    Preparing search index...

    Interface DefineEnvOptions<Schema>

    Options for defining a single validated env loader.

    interface DefineEnvOptions<Schema extends StandardSchemaV1> {
        emptyStringAsUndefined?: boolean;
        onValidationError?: (issues: readonly Issue[]) => never;
        prefix?: string;
        runtimeEnv?: RuntimeEnv;
        schema: Schema;
        skipValidation?: boolean;
    }

    Type Parameters

    Index

    Properties

    emptyStringAsUndefined?: boolean

    Treat empty strings as missing values before validation.

    onValidationError?: (issues: readonly Issue[]) => never

    Called when validation fails. Throw from this hook to customize the error.

    prefix?: string

    Optional prefix to filter env vars. Matching keys are stripped before validation, so APP_DATABASE_URL becomes DATABASE_URL.

    runtimeEnv?: RuntimeEnv

    Runtime environment object. Defaults to process.env when available.

    schema: Schema

    Standard Schema for validating the full environment object.

    skipValidation?: boolean

    Skip validation and return the raw env object. This is intended for build phases where real secrets are unavailable.