replicate-interceptor-rn
v0.1.0
Published
React Native interceptor package for the Replicate iOS Simulator developer tool
Maintainers
Readme
replicate-interceptor-rn
This plugin is a companion for the Replicate App — install Replicate on your Mac, add this plugin to your React Native app, and you're ready to record, restore, and tamper with your iOS Simulator sessions.
Replicate is a macOS developer tool that lets you save and restore full iOS Simulator app state snapshots. It captures your app's data container, records all network traffic, and lets you tamper with requests and responses — so you can reproduce any app state instantly and test edge cases without touching production.
This plugin hooks into your React Native app's network layer by patching XMLHttpRequest once. Since fetch and axios both use XHR under the hood in RN, they're covered automatically — no extra config needed. Replicate activates it on demand by writing a session config before launch. When that file is absent — normal dev runs, CI, production — init() returns immediately and patches nothing.
Install
npm install replicate-interceptor-rn
cd ios && pod installOptionally, install react-native-keychain to enable Keychain capture and restore (keeps login state across snapshot restores):
npm install react-native-keychain
cd ios && pod installSetup
index.js
Keep AppRegistry.registerComponent synchronous — do not await anything before it:
import { AppRegistry } from 'react-native';
import App from './src/App';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);App.tsx
Call init() before any navigation or auth logic renders:
import React, { useEffect, useState } from 'react';
import { ReplicateInterceptor } from 'replicate-interceptor-rn';
import RootNavigator from './navigation/RootNavigator';
export default function App() {
const [ready, setReady] = useState(false);
useEffect(() => {
ReplicateInterceptor.init().finally(() => setReady(true));
}, []);
if (!ready) return null;
return <RootNavigator />;
}That's it. Replicate handles the rest.
Requirements
- React Native ≥ 0.72
- iOS Simulator (macOS host)
- Replicate macOS app

