nitro-fetch

Installation
SKILL.md

react-native-nitro-fetch

A focused reference for AI coding assistants working in a project that uses the react-native-nitro-fetch family of packages. Answer using the real APIs from this repo — not invented ones — by routing to the matching references/*.md file below.

Mental model

react-native-nitro-fetch is a drop-in, native-backed replacement for the browser networking stack on React Native:

  • fetch — WHATWG-compatible, backed by URLSession (iOS) and OkHttp/HttpURLConnection (Android) via Nitro Modules.
  • NitroWebSocket — native WebSocket (libwebsockets + mbedTLS) with the same shape as the browser WebSocket.
  • NitroTextDecoder — native UTF-8 decoder that beats the Hermes JS polyfill.

The performance story has three moving parts, and most questions end up being about one of them:

  1. Prefetching. Native code can run before React Native loads. prefetchOnAppStart(...) and prewarmOnAppStart(...) replay stored requests / socket opens on every cold start, so by the time JS runs the response is already cached or the socket is already OPEN.
  2. Importing the native client. The default approach is explicit imports — import { fetch } from 'react-native-nitro-fetch', import { NitroWebSocket } from 'react-native-nitro-websockets', or plugging into axios via a custom adapter. Alternatively, users can do a global replace (globalThis.fetch = fetch, etc.) at the top of their entry file — see the Global Replace docs for setup and trade-offs.
  3. Seeing what's happening. NetworkInspector records HTTP + WS activity at the JS boundary; native Perfetto / Instruments traces cover everything below that (DNS, TLS, TTFB, body). One is for correctness, the other is for latency.

Routing table — problem to reference

Installs
8
GitHub Stars
890
First Seen
Apr 15, 2026
nitro-fetch — margelo/react-native-nitro-fetch