Interface ApiClientConfig

API Client Configuration options

Hierarchy

  • ApiClientConfig

Properties

baseUrl: string

Base URL for API requests

cacheStrategy?: CacheStrategy

Cache strategy

defaultHeaders?: Record<string, string>

Default headers to include with every request

errorInterceptors?: ErrorInterceptor[]

Error interceptors

rateLimit?: {
    maxRequests: number;
    perInterval: number;
    queueExceeding?: boolean;
}

Rate limiting options

Type declaration

  • maxRequests: number

    Maximum number of requests

  • perInterval: number

    Time interval in milliseconds

  • Optional queueExceeding?: boolean

    Whether to queue requests that exceed the rate limit

requestInterceptors?: RequestInterceptor[]

Request interceptors

responseInterceptors?: ResponseInterceptor[]

Response interceptors

retry?: {
    maxRetries: number;
    retryDelay: number;
    retryableStatusCodes?: number[];
    useExponentialBackoff?: boolean;
}

Whether to retry failed requests

Type declaration

  • maxRetries: number

    Maximum number of retry attempts

  • retryDelay: number

    Delay between retries in milliseconds

  • Optional retryableStatusCodes?: number[]

    Status codes that should trigger a retry

  • Optional useExponentialBackoff?: boolean

    Whether to use exponential backoff

timeout?: number

Default timeout for requests in milliseconds

withCredentials?: boolean

Whether to include credentials with requests

Generated using TypeDoc