OptionalbaseBase URL prepended to all relative request URLs.
OptionalheadersDefault headers sent with every request.
OptionalparamsDefault query parameters appended to every request URL.
OptionaltimeoutDefault request timeout in ms. 0 = no timeout. Default: 30_000
OptionalretryDefault retry policy.
OptionalauthDefault authentication.
OptionalproxyProxy configuration.
OptionalcacheHTTP cache configuration.
OptionalloggerLogging configuration.
OptionalthrowWhether to throw on HTTP error status codes (4xx/5xx). Default: true
OptionalmaxMaximum response body size in bytes. 0 = no limit. Default: 0
OptionalmaxMaximum request body size in bytes. 0 = no limit. Default: 0
OptionalfollowFollow redirects. Default: true
OptionalmaxMaximum number of redirects to follow. Default: 10
OptionalhttpsEnforce HTTPS-only requests. Rejects HTTP URLs. Default: false
OptionalhttpPreferred HTTP version. Default: "HTTP/2"
OptionalsessionHTTP/2 session pool tuning. Node.js only, and ignored when a custom
fetch is supplied (that forces FetchTransport, which cannot use
a session pool). See SessionPoolConfig.
OptionalconcurrencyBound how many requests may be in flight at once (a bulkhead).
Distinct from KinetexConfig.rateLimit, which bounds requests per
unit of time and releases its token at dispatch — so rateLimit: 100
per minute still permits 100 simultaneous sockets. A permit here is held
for the whole request, including its retries, and returned when it
settles.
OptionalfetchCustom fetch implementation (useful for testing).
Optionalinit: RequestInitOptionalinit: RequestInitOptionaldispatcherA fetch implementation extension forwarded verbatim to the runtime —
most usefully an undici dispatcher (Agent, ProxyAgent, MockAgent),
which is the only way to control HTTP/1.1 connection pooling, route
through an HTTP(S) proxy, or inject mock responses.
Typed as unknown to keep kinetex dependency-free. Node's fetch reads
init.dispatcher; Deno and Bun ignore it.
Supplying this forces the fetch transport, since the Node HTTP/2 transport has no notion of a dispatcher — see SessionPoolConfig.
OptionalinterceptorsInterceptors registered at construction time.
Optionalrequest?: RequestInterceptor[]Request interceptors run before the request is sent.
Optionalresponse?: ResponseInterceptor[]Response interceptors run after the response is received.
Optionalerror?: ErrorInterceptor[]Error interceptors run when an error occurs in the pipeline.
OptionalhooksLifecycle hooks registered at construction time.
OptionalcookieCookie jar instance. Pass true to auto-create one,
or a pre-existing instance.
OptionalharHAR recording. Pass true to enable with defaults.
OptionaltransformGlobal response transform applied after parsing.
OptionaltransformGlobal request transform applied before sending.
OptionalstrictEnforce strict header validation.
When true, requests with invalid header names or values throw a
KinetexError with code "EVALIDATION" instead of silently dropping
the offending header. Recommended for production services where silent
data loss is unacceptable.
Default: false — emit console.warn and drop.
OptionalrateBuilt-in token-bucket rate limiter applied to all outgoing requests.
Registered automatically as the highest-priority request interceptor so it runs before auth, cache, and dedup.
Optionallimit?: numberMaximum requests per window. Default: 60
OptionalwindowMs?: numberWindow size in ms. Default: 60_000 (1 minute)
Optionalqueue?: booleanIf true, queue excess requests; if false, reject immediately. Default: true
OptionalmaxQueue?: numberMax number of queued requests before rejecting. Default: 100
OptionalwsDefault WebSocket client configuration inherited by client.ws().
These values are merged with per-call options.
OptionalhighWaterMark?: numberHigh-water mark in bytes for backpressure. Default: 65536
OptionallowWaterMark?: numberLow-water mark in bytes for backpressure release. Default: 16384
OptionalmaxSendRate?: numberMax outbound messages per second (0 = unlimited). Default: 0
OptionalkeepRooms?: booleanAutomatically re-join subscribed rooms after reconnect. Default: true
OptionalcircuitCustom function to compute the circuit-breaker key for a request.
Default behavior: key = request origin (https://api.example.com).
Override to scope breakers per-method, per-route, or per-tenant.
OptionalawsAWS SigV4 request signing applied automatically to every outgoing request.
When set, a SigV4Signer is registered as a request interceptor that
signs headers (Authorization, x-amz-date, x-amz-content-sha256) before
the request is sent. Compatible with all AWS services and API Gateway.
OptionalonPipeline trace callback — called at the start and end of each pipeline stage for every request.
Use this for detailed observability without adding interceptors: structured logging, distributed tracing, or performance profiling.
The callback is synchronous and must not throw.
OptionalonCalled when a background stale-while-revalidate (SWR) fetch fails.
Without this callback, SWR revalidation errors are silently swallowed and stale data continues to be served. Use this hook to monitor revalidation health, increment error counters, or trigger alerts.
The error that caused the revalidation to fail.
The request that was being revalidated.
Global configuration for a
Kinetexclient instance.