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.
| Export | Purpose |
|---|---|
createHttpClient | Creates typed request methods |
buildUrl | Joins paths and serializes query values |
readResponseBody | Reads empty, JSON, text, and HTML responses |
ApiError | Preserves status, URL, and response body |
isAbortError | Distinguishes 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.