Skip to content

UseFetchApi

katanakit-js / useFetchApi

function useFetchApi<T>(
apiName,
endpointName,
options?
): Promise<FetchResult<T>>;

Defined in: core/services/http.service.ts:664

Fetches a registered endpoint and returns a Safe Result. Alias for useFetch.

Type Parameter Default type
T unknown
Parameter Type Description
apiName string The registered API key.
endpointName string The endpoint key within the API.
options? FetchOptions<T> Optional fetch options.

Promise<FetchResult<T>>

A FetchResult with data or error.