@runloop/api-client - v1.26.0
    Preparing search index...

    Interface ClientOptions

    interface ClientOptions {
        bearerToken?: string;
        baseURL?: string | null;
        timeout?: number;
        httpAgent?: Agent;
        fetch?: Fetch;
        http2?: boolean | H2PoolOptions;
        maxRetries?: number;
        defaultHeaders?: Headers;
        defaultQuery?: DefaultQuery;
    }
    Index

    Properties

    bearerToken?: string

    Defaults to process.env['RUNLOOP_API_KEY'].

    baseURL?: string | null

    Override the default base URL for the API, e.g., "https://api.example.com/v2/"

    Defaults to process.env['RUNLOOP_BASE_URL'].

    timeout?: number

    The maximum amount of time (in milliseconds) that the client should wait for a response from the server before timing out a single request.

    Note that request timeouts are retried by default, so in a worst-case scenario you may wait much longer than this timeout before the promise succeeds or fails.

    httpAgent?: Agent

    An HTTP agent used to manage HTTP(S) connections.

    If not provided, an agent will be constructed by default in the Node.js environment, otherwise no agent is used.

    fetch?: Fetch

    Specify a custom fetch function implementation.

    If not provided, we use node-fetch on Node.js and otherwise expect that fetch is defined globally.

    http2?: boolean | H2PoolOptions

    Send requests over HTTP/2 using native node:http2 connection pools.

    HTTP/2 is the default transport on Node.js: it multiplexes many concurrent requests over a small number of TLS connections instead of opening one connection per request.

    • true / omitted uses the SDK's default bounded HTTP/2 pool.
    • Pass H2FetchOptions to tune pool size, timeouts, etc.
    • false opts out and uses the HTTP/1.1 node-fetch transport.

    On the HTTP/2 path the httpAgent option is not used — the H2 transport manages its own persistent connections. Passing an httpAgent without an explicit http2 value keeps the client on HTTP/1.1 (with a one-time warning); pass http2: false to opt out silently.

    true
    
    maxRetries?: number

    The maximum number of times that the client will retry a request in case of a temporary failure, like a network error or a 5XX error from the server.

    5
    
    defaultHeaders?: Headers

    Default headers to include with every request to the API.

    These can be removed in individual requests by explicitly setting the header to undefined or null in request options.

    defaultQuery?: DefaultQuery

    Default query parameters to include with every request to the API.

    These can be removed in individual requests by explicitly setting the param to undefined in request options.