Beignet API reference
    Preparing search index...

    Type Alias ClientConfig<TProvidedHeaders>

    Configuration for a Beignet contract client.

    type ClientConfig<TProvidedHeaders extends string = never> = {
        baseUrl?: string;
        fetch?: typeof fetch;
        headers?: () => Promise<Record<string, string>> | Record<string, string>;
        providedHeaders?: readonly TProvidedHeaders[];
        validate?: boolean;
    }

    Type Parameters

    • TProvidedHeaders extends string = never
    Index

    Properties

    baseUrl?: string

    Base URL prepended to all endpoint paths.

    fetch?: typeof fetch

    Fetch implementation. Defaults to global fetch.

    headers?: () => Promise<Record<string, string>> | Record<string, string>

    Static or async headers applied to every request.

    providedHeaders?: readonly TProvidedHeaders[]

    Header keys supplied by global headers, making them optional per call.

    validate?: boolean

    Enable client-side input validation for path, query, and body. Default: false.