Releases: openfetch-js/OpenFetch
v1.0.0
OpenFetch v1.0.0
First stable release on the 1.x line. OpenFetch stays a small, zero–runtime-dependency HTTP client built on the standard fetch API, with ESM-only builds and a focus on middleware, retries, timeouts, and safe defaults for server and edge runtimes (Node 18+, Bun, Deno, browsers, Cloudflare Workers, etc.).
Highlights
Transport: single code path through fetch — no legacy browser globals; friendly to SSR and React Server Components.
Instances: createClient() / create() with shared defaults, interceptors, and composable use() middleware.
Retries & timeouts: createRetryMiddleware() / retry() plugin with backoff, total and per-attempt time budgets, abort-safe behavior, and idempotency key handling for retried POSTs when opted in.
Caching: in-memory cache middleware with TTL and optional stale-while-revalidate; cache-key guidance for auth-sensitive GETs.
Fluent API (@hamdymohamedak/openfetch/sugar): chainable verbs and terminals; .memo() for one round-trip with multiple body reads; .raw() for native Response without adapter parsing on that path.
Validation & HTTP semantics: validateStatus, Ky-style throwHttpErrors, and jsonSchema via Standard Schema (e.g. Zod 3.24+), including fluent .json(schema).
Lifecycle: config init hooks; hooks() plugin with retry-aware callbacks such as onBeforeRetry / onAfterResponse (including OpenFetchForceRetry for controlled extra attempts).
Observability: structured debug / logger pipeline events; debug() plugin with URL query redaction and header masking strategies (partial / hash).
Hardening: optional assertSafeUrl / assertSafeHttpUrl for server-side URL guardrails (see SECURITY.md for scope and limits).
Install
npm install @hamdymohamedak/openfetch@^1
Subpath exports for tree-shaking: @hamdymohamedak/openfetch, @hamdymohamedak/openfetch/plugins, @hamdymohamedak/openfetch/sugar.
Docs & project links
Docs: openfetch-js.github.io/openfetch-docs/
Changelog: CHANGELOG.md
Security: SECURITY.md