A tiny fetch wrapper with an intuitive syntax
Wretch 3.0 gives JavaScript developers a tiny (<1.8KB gzipped), TypeScript-typed fetch wrapper with chainable error handling, removing repetitive HTTP boilerplate.
Wretch is a free, open-source helper library for JavaScript that makes sending web requests easier. Normally, fetching data from a server means writing the same repetitive code, checking for errors, converting responses, over and over. Wretch lets developers write those steps as a short, readable chain instead. It works in browsers and in server runtimes like Node.js, Deno and Bun.
Wretch 3.0 is a free, MIT-style community library competing with native fetch and similar wrappers like ky. Its cost is negligible, under 1.8KB gzipped, and it has years of maintenance plus full unit-test coverage, limiting adoption risk. The downside is dependency on a small project rather than a vendor. Teams building API-heavy front-ends gain the most.
Wretch 3.0 wraps the Fetch API with a chainable, immutable API where every call clones the instance, enabling safe shared base clients. Core is under 1.8KB gzipped, written in TypeScript, and isomorphic across modern browsers, Node.js 22+, Deno and Bun. It handles serialization, response typing (.json(), .text(), .res(), .blob()), and chainable per-status error handlers like .notFound(). Addons and middlewares extend it; a v2-to-v3 migration guide exists.