Fetch Client API Documentation - v1.1.1
    Preparing search index...

    Interface ClientConfig

    Configuration for the API client instance

    Global settings applied to all requests made by the client

    const config: ClientConfig = {
    baseURL: 'https://api.example.com',
    timeout: 15000,
    headers: {
    'Authorization': 'Bearer token123',
    'Content-Type': 'application/json',
    'User-Agent': 'MyApp/1.0'
    },
    responseType: 'json',
    retry: { maxRetries: 3, delay: 1000 }
    };
    interface ClientConfig {
        baseURL?: string;
        timeout?: number;
        retry?: number | RetryConfig;
        headers?: Record<string, string>;
        responseType?: ResponseType;
    }

    Hierarchy

    Index

    Properties

    baseURL?: string

    Base URL for the request - will be combined with url

    'https://api.example.com'
    
    timeout?: number

    Request timeout in milliseconds before aborting

    10000 // 10 second timeout
    
    retry?: number | RetryConfig

    Retry configuration for failed requests

    3 // Simple: retry 3 times with defaults
    
    { maxRetries: 5, delay: 2000 } // Advanced configuration
    
    headers?: Record<string, string>

    Default headers for all requests made by this client

    These headers will be merged with request-specific headers

    { 'Authorization': 'Bearer token', 'Content-Type': 'application/json' }
    
    responseType?: ResponseType

    Default response type for all requests

    Can be overridden per request

    'json' // Default to JSON parsing for all responses