Skip to main content

Default fetcher

By default, kweri uses the global fetch with minimal config:
The response is expected to be a Response-like object that kweri can call .json() on.

Fetcher interface

Common patterns

Authorization headers

Token refresh

Request timeout

Node.js / non-browser environments

Use any fetch-compatible library. In Node.js 18+ the global fetch is available; for older versions use node-fetch or undici:

Custom response unwrapping

If your API wraps all responses in an envelope ({ data: ..., meta: ... }), unwrap in the fetcher:
The fetcher must return something kweri can call .json() on. Returning a raw parsed object won’t work — wrap it in a Response if needed.