ClientConfig
Type Alias: ClientConfig
Section titled “Type Alias: ClientConfig”ClientConfig =
object
Defined in: packages/fetch-kit/src/types.ts:156
Configuration for createClient.
Properties
Section titled “Properties”
optionalauth?:AuthFn
Defined in: packages/fetch-kit/src/types.ts:175
Resolve the credential to attach to each request.
Returns the full Authorization header value (e.g. "Bearer xyz",
"Basic dXNlcjpwYXNz", "Token xyz", or a raw key). Return an object
to set a custom header (X-Api-Key, etc.) or to split scheme + token.
Return null/undefined to skip auth for the request.
AuthResult
baseUrl?
Section titled “baseUrl?”
optionalbaseUrl?:string
Defined in: packages/fetch-kit/src/types.ts:158
Base URL prepended to relative paths. e.g. "https://api.example.com"
cache?
Section titled “cache?”
optionalcache?:boolean|CacheConfig
Defined in: packages/fetch-kit/src/types.ts:189
Enable response caching. Pass true to use defaults, an object to tune,
or omit to disable. Caching applies to GET requests and GraphQL queries
by default; mutations are never cached.
dedupe?
Section titled “dedupe?”
optionaldedupe?:boolean
Defined in: packages/fetch-kit/src/types.ts:195
Enable in-flight request deduplication. When two identical GET or query
requests fire concurrently, both await a single underlying fetch.
Defaults to true.
fetch?
Section titled “fetch?”
optionalfetch?: typeoffetch
Defined in: packages/fetch-kit/src/types.ts:183
Custom fetch implementation. Defaults to global fetch.
graphqlEndpoint?
Section titled “graphqlEndpoint?”
optionalgraphqlEndpoint?:string
Defined in: packages/fetch-kit/src/types.ts:200
GraphQL endpoint path or absolute URL. Required for Client.graphql
unless an explicit url is passed per request.
headers?
Section titled “headers?”
optionalheaders?:Record<string,string>
Defined in: packages/fetch-kit/src/types.ts:164
Default headers merged into every request.
onError?
Section titled “onError?”
optionalonError?: (error) =>void
Defined in: packages/fetch-kit/src/types.ts:177
Hook called when any request errors. Useful for telemetry.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
requestInterceptors?
Section titled “requestInterceptors?”
optionalrequestInterceptors?:RequestInterceptor[]
Defined in: packages/fetch-kit/src/types.ts:179
Request interceptors run in order.
responseInterceptors?
Section titled “responseInterceptors?”
optionalresponseInterceptors?:ResponseInterceptor[]
Defined in: packages/fetch-kit/src/types.ts:181
Response interceptors run in order.
retry?
Section titled “retry?”
optionalretry?:RetryConfig
Defined in: packages/fetch-kit/src/types.ts:162
Default retry configuration.
timeout?
Section titled “timeout?”
optionaltimeout?:number
Defined in: packages/fetch-kit/src/types.ts:160
Default request timeout in milliseconds. Defaults to 30000.