StatsHub Docs
Packages

api-client

Platform-neutral HTTP transport used by the Expo app.

statshub-api-client has no React, Next.js, Expo, or authentication dependency. Expo is its current consumer.

ExportPurpose
createHttpClientCreates typed request methods
buildUrlJoins paths and serializes query values
readResponseBodyReads empty, JSON, text, and HTML responses
ApiErrorPreserves status, URL, and response body
isAbortErrorDistinguishes cancellation from network failure

Nullish query values are omitted, arrays use comma-separated values, request bodies are JSON encoded, and non-success responses throw ApiError. A network failure uses status 0; cancellation remains an abort error.

getHeaders is a per-request injection seam. The caller still owns session storage and authentication.

See Expo data for caching and retry policy.