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"
OptionalfetchCustom fetch implementation (useful for testing).
Optionalinit: RequestInitOptionalinit: RequestInitOptionalinterceptorsInterceptors 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.