PitchKit
API Reference@pitchkit/data-providersindexFunctions

fetchJson()

function fetchJson<T>(url, options?): Promise<T>;

Defined in: packages/data-providers/src/fetch-json.ts:22

GET a URL and parse it as JSON, translating every failure mode into a DataProviderError with a kind the caller can branch on.

Deliberately built on the global fetch rather than an HTTP client — see http.ts for the shared request path.

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterType
urlstring
optionsLoadOptions

Returns

Promise<T>

On this page