Type Alias: ValifetchBaseOptions
ValifetchBaseOptions =
Omit<RequestInit,"body"|"method"|"window"> &object
Defined in: src/types/options.ts:203
Base options without schemas (for internal use)
Type Declaration
debug?
optionaldebug?:DebugOption
Enable structured debug logging of request lifecycle events. Pass true to emit via console.debug, or a function to handle events directly.
dedupe?
optionaldedupe?:boolean
Deduplicate concurrent identical requests. The dedupe key is method plus the fully-resolved URL — prefixUrl + path params + merged search params, computed from the raw pre-validation values — scoped per instance (including instances created via create() with no arguments, each of which gets its own cache). The key deliberately excludes headers, the request body, and schemas, so two calls that differ only by header or body are treated as identical and collapsed into one in-flight request — avoid enabling dedupe for such calls, and avoid it on non-idempotent methods (POST, PATCH, DELETE) where collapsing distinct requests would be incorrect. Calling .cancel() on a deduplicated promise aborts the shared request for every caller awaiting it.
Default
falsehooks?
optionalhooks?:Hooks
Hooks for request lifecycle
onDownloadProgress?
optionalonDownloadProgress?: (event) =>void
Callback fired as response body bytes are received. Not called when responseType is 'stream', 'raw' or 'sse' — the caller owns the stream in those modes.
Parameters
event
Returns
void
prefixUrl?
optionalprefixUrl?:string
Base URL prefix for all requests. Resolved request paths must stay under it (a .. escape throws a TypeError). Must not contain a query string or fragment (?/# throws a TypeError); use searchParams for defaults.
retry?
optionalretry?:RetryOptions|number|false
Retry configuration or limit number
searchParams?
optionalsearchParams?:SearchParamsInit
Search/query parameters.
Instance-level values act as defaults: per-request params are merged on top, and a key present in both is taken from the request (all instance-level entries for that key are dropped). A request key explicitly set to undefined/null removes the instance default for that key entirely, rather than leaving it in place.
sseMaxEventSize?
optionalsseMaxEventSize?:number
Largest single Server-Sent Event the responseType: 'sse' parser buffers, in UTF-16 code units (one per ASCII character). A pending event that grows past it cancels the stream and throws a PARSE_ERROR, bounding memory against a server that never sends an event boundary. Infinity disables the cap; a non-number, NaN or negative value falls back to the default. Allowed at instance level (merged by create/extend) and per call; the per-call value wins. Ignored for every other responseType.
Default
16777216 (16 MiB)throwHttpErrors?
optionalthrowHttpErrors?:boolean
Throw on non-2xx status codes (default: true)
timeout?
optionaltimeout?:number
Request timeout in milliseconds.
Default
undefined — requests never time out; 0 also disables the timeout
validateRequest?
optionalvalidateRequest?:boolean
Enable/disable request body/params/search validation (default: true)
validateResponse?
optionalvalidateResponse?:boolean
Enable/disable response schema validation (default: true)