FetchClient is a tiny, typed wrapper around fetch
with JSON helpers, caching,
middleware, rate limiting, timeouts, and friendly error handling.
npm install @foundatiofx/fetchclient
import { FetchClient } from "@foundatiofx/fetchclient";
type Products = { products: Array<{ id: number; name: string }> };
const client = new FetchClient();
const { data } = await client.getJSON<Products>(
`https://dummyjson.com/products/search?q=iphone&limit=10`,
);
console.log(data?.products.length);
- Guide & Examples: https://fetchclient.foundatio.dev
- Getting Started, Usage Examples, Contributing
- API Reference: https://jsr.io/@foundatiofx/fetchclient/doc
MIT © Foundatio