nitro-fetch

Implements native networking, prefetching, and WebSocket workflows for React Native apps.

172|8|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/margelo/react-native-skills --skill nitro-fetch-margelo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nitro-fetch
Source: https://github.com/margelo/react-native-skills/tree/main/skills/react-native-nitro-fetch
Command: npx skills add https://github.com/margelo/react-native-skills --skill nitro-fetch-margelo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react-native-nitro-fetch, react-native-nitro-websockets, react-native-nitro-text-decoder, react-native-nitro-modules, and includes references (resource) components.

What problem does it solve? React Native's built-in networking stack is slow on cold starts, lacks custom WebSocket headers on iOS, and hides native request timing from developers. This Skill guides AI assistants to use the real APIs from the react-native-nitro-fetch family — native fetch, NitroWebSocket, and a fast TextDecoder — instead of inventing nonexistent helpers. ## Core Features & Use Cases - Cold-start prefetching: Persist requests with prefetchOnAppStart and prefetchKey so native code replays them before React Native boots, with configurable cache TTL and token refresh. - Native WebSockets: Use NitroWebSocket with custom upgrade headers, binary frames, pre-warming via prewarmOnAppStart, and a guided migration path from React Native's built-in WebSocket. - Observability: Record HTTP and WebSocket traffic with the in-process NetworkInspector, then escalate to Perfetto or Instruments traces for DNS/TLS/TTFB breakdowns. - Use Case: Your app's home feed takes over a second to render on cold start. Use this Skill to schedule a cross-launch prefetch with token refresh, wire the Android Application.onCreate bootstrap, and verify the cache hit in the NetworkInspector. ## Quick Start Ask the assistant how to make cold-start GET requests feel instant in a React Native app using nitro-fetch prefetching.

Frequently Asked Questions about nitro-fetch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prefetch API requests before React Native loads?

Call prefetchOnAppStart with a URL and prefetchKey after sign-in; the request is persisted and replayed natively on the next cold start. On Android you must also add AutoPrefetcher.prefetchOnStart(this) in Application.onCreate, while iOS bootstraps automatically.

How do I route axios through nitro-fetch?

Create a custom axios adapter that calls the fetch export from react-native-nitro-fetch and pass it to axios.create. A correct adapter must handle baseURL, params, timeout, signal, responseType, and validateStatus rather than just JSON-parsing every response.

How do I migrate from React Native WebSocket to NitroWebSocket?

Replace new WebSocket with new NitroWebSocket, convert numeric readyState checks to strings like 'OPEN', replace addEventListener with property assignment, drop binaryType in favor of e.isBinary, and send only string or ArrayBuffer payloads.

Does nitro-fetch traffic appear in React Native DevTools?

No. React Native DevTools hooks XMLHttpRequest, and nitro-fetch bypasses XHR entirely via Nitro and JSI. Use the built-in NetworkInspector for JS-level visibility or Perfetto and Instruments traces for native DNS, TLS, and TTFB breakdowns.

Why is my prefetch not being used on cold start?

The most common causes are a missing or mismatched prefetchKey between the prefetch and the consuming fetch, the entry expiring past the default 5-second TTL, or the missing AutoPrefetcher.prefetchOnStart line in Android's Application.onCreate.

Can I prewarm a WebSocket connection before the app boots?

Yes. Call prewarmOnAppStart with the wss URL, protocols, and headers; native code opens the socket before React Native loads and buffers messages. Your screen adopts the warm connection by constructing NitroWebSocket with the exact same URL.