Configuration Options

Detailed type specifications and default values for RequestConfig and ClientConfig.


RequestConfig Options Reference

RequestConfig Properties
PropertyTypeDefaultDescription
baseURL / baseUrlstringClient setting or undefinedBase URL used to resolve a relative request URL. baseUrl is an alias.
urlrequiredstring—The endpoint URL (absolute or relative to baseURL).
methodHttpMethod'GET''GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS'.
headersHeadersInit{}Custom HTTP headers merged over client default headers.
paramsQueryParamsundefinedURL query parameters serialized with RFC 3986 encoding.
pathParamsPathParamsundefinedPath variables interpolated into URL tokens like /users/:id or /orgs/{org}.
bodyBodyInit | Record<string, unknown> | unknown[] | nullundefinedRequest payload. Plain objects are automatically JSON stringified.
timeoutnumber0Per-request timeout in milliseconds.
signalAbortSignalundefinedWHATWG AbortSignal to trigger request cancellation.
cancelPreviousstringundefinedCancellation group key; a newer request with the same key aborts the previous pending request.
responseTypeResponseType'json''json' | 'text' | 'blob' | 'arrayBuffer' | 'none' | 'stream'.
unwrapbooleanfalseIf true, directly returns response.data instead of the full HttpResponse wrapper.
schemaSchemaValidator<unknown>undefinedStandard Schema v1, Zod schema, or validation function for runtime validation.
retryPartial<RetryPolicy>undefinedCustom retry policy overriding client defaults.
cacheRequestCacheConfig | booleanundefinedPer-request cache override: skip, TTL, ETag validation, SWR strategy, revalidation callbacks, or invalidation patterns.
dedupDedupConfig | booleanundefinedPer-request deduplication options.
bearerTokenstring | (() => string | null | undefined | Promise<...>)undefinedStatic token or callback used to attach a Bearer token when no Authorization header is already set.
authboolean | { skip?: boolean }undefinedRequest-level authentication override; false or { skip: true } bypasses configured auth behavior.
credentialsRequestCredentialsFetch defaultCredentials behavior passed to fetch().
redirectRequestRedirect'follow'Redirect behavior passed to fetch().
dispatcherunknownundefinedOptional Node.js Undici dispatcher passed through to fetch().
formUrlEncodedbooleanfalseSerialize a plain object body as application/x-www-form-urlencoded.
onDownloadProgress / onUploadProgress(event: ProgressEvent) => voidundefinedTransfer callbacks with loaded, optional total, optional progress fraction, and bytes fields.
fetchImplFetchImplClient setting or globalThis.fetchOverride the Fetch implementation for this request.
debugboolean | DebugLoggerClient setting or falseEnable request diagnostics or send diagnostic entries to a callback.
circuitBreakerCircuitBreakerConfig | booleanClient setting or disabledOverride 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
PropertyTypeDefaultDescription
retryPartial<RetryPolicy>0 attemptsDefault retry policy; retries are opt-in.
dedupDedupConfigDisabledIn-flight deduplication settings.
cacheCacheConfigDisabledCache TTL, strategy, size, ETag, and optional storage adapter.
authAuthConfigundefinedRequires getToken; refreshToken and other auth options are optional.
bearerTokenstring | (() => string | null | undefined | Promise<...>)undefinedStatic or dynamic Bearer token shortcut.
maxConcurrentRequestsnumberUnlimitedMaximum concurrent active requests; zero or undefined means unlimited.
circuitBreakerCircuitBreakerConfigDisabledCircuit breaker configuration; enabled must be true to activate it.
fetchImplFetchImplglobalThis.fetchFetch implementation used by all requests from the client.
debugboolean | DebugLoggerfalseEnable request diagnostics or provide a custom logger.
unwrapbooleanfalseAt runtime, return response data rather than the response envelope.