Configuration Options
Detailed type specifications and default values for RequestConfig and ClientConfig.
RequestConfig Options Reference
RequestConfig Properties
| Property | Type | Default | Description |
|---|---|---|---|
| baseURL / baseUrl | string | Client setting or undefined | Base URL used to resolve a relative request URL. baseUrl is an alias. |
| urlrequired | string | — | The endpoint URL (absolute or relative to baseURL). |
| method | HttpMethod | 'GET' | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS'. |
| headers | HeadersInit | {} | Custom HTTP headers merged over client default headers. |
| params | QueryParams | undefined | URL query parameters serialized with RFC 3986 encoding. |
| pathParams | PathParams | undefined | Path variables interpolated into URL tokens like /users/:id or /orgs/{org}. |
| body | BodyInit | Record<string, unknown> | unknown[] | null | undefined | Request payload. Plain objects are automatically JSON stringified. |
| timeout | number | 0 | Per-request timeout in milliseconds. |
| signal | AbortSignal | undefined | WHATWG AbortSignal to trigger request cancellation. |
| cancelPrevious | string | undefined | Cancellation group key; a newer request with the same key aborts the previous pending request. |
| responseType | ResponseType | 'json' | 'json' | 'text' | 'blob' | 'arrayBuffer' | 'none' | 'stream'. |
| unwrap | boolean | false | If true, directly returns response.data instead of the full HttpResponse wrapper. |
| schema | SchemaValidator<unknown> | undefined | Standard Schema v1, Zod schema, or validation function for runtime validation. |
| retry | Partial<RetryPolicy> | undefined | Custom retry policy overriding client defaults. |
| cache | RequestCacheConfig | boolean | undefined | Per-request cache override: skip, TTL, ETag validation, SWR strategy, revalidation callbacks, or invalidation patterns. |
| dedup | DedupConfig | boolean | undefined | Per-request deduplication options. |
| bearerToken | string | (() => string | null | undefined | Promise<...>) | undefined | Static token or callback used to attach a Bearer token when no Authorization header is already set. |
| auth | boolean | { skip?: boolean } | undefined | Request-level authentication override; false or { skip: true } bypasses configured auth behavior. |
| credentials | RequestCredentials | Fetch default | Credentials behavior passed to fetch(). |
| redirect | RequestRedirect | 'follow' | Redirect behavior passed to fetch(). |
| dispatcher | unknown | undefined | Optional Node.js Undici dispatcher passed through to fetch(). |
| formUrlEncoded | boolean | false | Serialize a plain object body as application/x-www-form-urlencoded. |
| onDownloadProgress / onUploadProgress | (event: ProgressEvent) => void | undefined | Transfer callbacks with loaded, optional total, optional progress fraction, and bytes fields. |
| fetchImpl | FetchImpl | Client setting or globalThis.fetch | Override the Fetch implementation for this request. |
| debug | boolean | DebugLogger | Client setting or false | Enable request diagnostics or send diagnostic entries to a callback. |
| circuitBreaker | CircuitBreakerConfig | boolean | Client setting or disabled | Override the client circuit breaker or disable it for this request. |
ClientConfig Options
ClientConfig extends request defaults and adds shared policies. All options below are optional; only set auth when you can provide its required getToken callback.
ClientConfig Properties
| Property | Type | Default | Description |
|---|---|---|---|
| retry | Partial<RetryPolicy> | 0 attempts | Default retry policy; retries are opt-in. |
| dedup | DedupConfig | Disabled | In-flight deduplication settings. |
| cache | CacheConfig | Disabled | Cache TTL, strategy, size, ETag, and optional storage adapter. |
| auth | AuthConfig | undefined | Requires getToken; refreshToken and other auth options are optional. |
| bearerToken | string | (() => string | null | undefined | Promise<...>) | undefined | Static or dynamic Bearer token shortcut. |
| maxConcurrentRequests | number | Unlimited | Maximum concurrent active requests; zero or undefined means unlimited. |
| circuitBreaker | CircuitBreakerConfig | Disabled | Circuit breaker configuration; enabled must be true to activate it. |
| fetchImpl | FetchImpl | globalThis.fetch | Fetch implementation used by all requests from the client. |
| debug | boolean | DebugLogger | false | Enable request diagnostics or provide a custom logger. |
| unwrap | boolean | false | At runtime, return response data rather than the response envelope. |