A fetch wrapper that bridges HTTP requests from a React Native WebView to the native app, enabling file downloads and other network operations that cannot be handled inside a WebView. Current stable version is 0.1.3, released as a new package with no prior major versions. Key differentiators: provides a drop-in `fetchBridge()` replacement that works identically to `fetch` in browsers, uses a message-passing pattern via `postMessage`/`onMessage`, and offers a `setupFetchHandler()` hook on the native side with optional `onFetch` callback for custom response handling (e.g., saving files to disk). Ships TypeScript types and requires `react-native >=0.70.0` and `react-native-webview >=11.0.0` as peer dependencies. The library does not transfer credentials (cookies, tokens) from the WebView; authentication must be handled natively.
npm install fetch-native-bridgeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Replaces fetch() with fetchBridge() in a React Native WebView; includes timeout and bearer token.
Pass auth tokens as headers in the fetchBridge call or handle authentication in the native onFetch callback.
Use isReactNativeWebView() to conditionally call fetchBridge or fallback to fetch.
Use import { setupFetchHandler } from 'fetch-native-bridge/native'.Ensure the code runs inside a React Native WebView, or use isReactNativeWebView() to guard.
Update bundler to support package.json exports field, or import from correct path.
Check that setupFetchHandler is properly set up and the native onMessage handler is registered.