Skip to content

Fetch Helpers

Utility functions for working with fetch operations.

FunctionDescription
fetchJsonFetches a URL and returns its parsed JSON body, retrying transient failures.
fetchOrThrowWraps `fetch` so that a non-2xx response rejects with an HttpError, instead of resolving like any other response — the…
safeFetchWraps `fetch` with built-in error handling: returns `null` when the request fails (network error, non-OK status, or par…