Features Overview
A high-level architectural index of every native capability built into react-native-fetch-client with zero runtime dependencies.
Core Capabilities
Uses Fetch APIs and has no production runtime dependencies in the package manifest.
When multiple concurrent requests fail with HTTP 401, a mutex ensures only one refresh token handshake occurs. All waiting requests are automatically re-executed with the new bearer token once resolved.
Optional in-memory LRU caching with stale-while-revalidate and request-level cache settings. Successful mutations invalidate matching cached paths; add cache.invalidate patterns for related routes.
Exponential backoff with full jitter to avoid the thundering herd problem. Honors HTTP Retry-After headers and includes a Circuit Breaker that fails fast during server degradation.
Matching eligible requests share one in-flight network operation. If one caller aborts, the shared operation can continue for remaining callers.
Read Server-Sent Events or chunked responses with the api.stream() async generator. Runtime stream support is required.
Iterate pages seamlessly using async generators across page, offset, cursor, or RFC 5988 Link header strategies. Includes smart polling with exponential backoff.
A built-in createMockAdapter for registering mock handlers and inspecting recorded requests.
Runtime requirements
The package uses the runtime's Fetch implementation. Availability of streams, persistent storage adapters, and platform integrations depends on your environment and the adapters you provide. The package metadata declares Node.js 18 or newer; see the platform guides for details.