@basetenlabs/sandbox - v0.3.0
    Preparing search index...

    Interface SandboxClientOptions

    Options for SandboxClient.

    interface SandboxClientOptions {
        apiKey: string;
        baseUrlOverride?: string;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        headers?: Record<string, string>;
        nodeUndici?: boolean;
        retries?: SandboxRetryOptions;
        teamId?: string;
        tokenProvider?: SandboxTokenProvider;
    }
    Index
    apiKey: string

    API key for authentication. Empty, together with tokenProvider, is the advanced opt-out of API key authentication.

    baseUrlOverride?: string

    Explicit base URL override for the management API, or undefined to use the default.

    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    }

    Custom fetch implementation. Defaults to globalThis.fetch.

    Type Declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | URL | Request, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | URL | Request
        • Optionalinit: RequestInit

        Returns Promise<Response>

    headers?: Record<string, string>

    Additional headers to send on every request.

    nodeUndici?: boolean

    Whether to send requests on Node through the optional undici package.

    With undici, requests use HTTP/2 with flow control windows sized for large downloads. Without it, they use Node's own fetch: HTTP/1.1 before Node 26, and from Node 26 on, HTTP/2 with small windows that slow large downloads. Supported undici versions are 7.19.0 and newer 7.x, plus 8.x on Node 26 and newer. Other versions count as not installed.

    When unset, undici is used if a supported version is installed and the app has not set its own global dispatcher, such as a proxy. A plain undici Agent set as the global dispatcher cannot be told apart from the one undici installs itself, so an app that customizes one should pass false or its own fetch to keep it in charge. The app's own fetch is left unchanged. true requires undici and fails requests with an error saying why it cannot be used. false never loads it. Has no effect outside Node, or when fetch is supplied.

    Retry budgets for transient failures.

    teamId?: string

    Team to act in. Unset uses the caller's only team, and is an error for callers in more than one team.

    tokenProvider?: SandboxTokenProvider

    Returns the bearer token for each request, instead of one derived from the API key, which must then be empty.