{"id":47708321,"url":"https://github.com/twinedo/rn-netinspect","last_synced_at":"2026-06-30T02:00:45.480Z","repository":{"id":345025678,"uuid":"1184077161","full_name":"twinedo/rn-netinspect","owner":"twinedo","description":"Inspect React Native network requests across simulator, emulator, and real devices.","archived":false,"fork":false,"pushed_at":"2026-06-25T04:43:33.000Z","size":276,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T06:19:17.546Z","etag":null,"topics":["android","axios","debugging","expo","fetch","ios","network-inspector","proxy","react-native","xhr"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@twinedo/rn-netinspect","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twinedo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-17T08:23:21.000Z","updated_at":"2026-06-25T04:43:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/twinedo/rn-netinspect","commit_stats":null,"previous_names":["twinedo/rn-netinspect"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/twinedo/rn-netinspect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinedo%2Frn-netinspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinedo%2Frn-netinspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinedo%2Frn-netinspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinedo%2Frn-netinspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twinedo","download_url":"https://codeload.github.com/twinedo/rn-netinspect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinedo%2Frn-netinspect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34949234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","axios","debugging","expo","fetch","ios","network-inspector","proxy","react-native","xhr"],"created_at":"2026-04-02T18:08:16.653Z","updated_at":"2026-06-30T02:00:45.474Z","avatar_url":"https://github.com/twinedo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/twinedo/rn-netinspect/6411701027319155e3ef817dc7a42a0d76fe8b34/assets/readme/banner.svg\" alt=\"React Native NetInspect banner\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eReact Native NetInspect\u003c/h1\u003e\n\u003cp align=\"center\"\u003eInspect React Native traffic across simulator, emulator, and real devices.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@twinedo/rn-netinspect\"\u003e\u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/@twinedo/rn-netinspect?color=00d4ff\u0026label=npm\"\u003e\u003c/a\u003e\n  \u003cimg alt=\"platforms\" src=\"https://img.shields.io/badge/platforms-iOS%20%7C%20Android-1f2937\"\u003e\n  \u003cimg alt=\"runtime\" src=\"https://img.shields.io/badge/runtime-React%20Native-111827\"\u003e\n  \u003cimg alt=\"license\" src=\"https://img.shields.io/npm/l/@twinedo/rn-netinspect?color=7c3aed\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Dashboard on \u003ccode\u003e:19826\u003c/code\u003e. Optional proxy on \u003ccode\u003e:8899\u003c/code\u003e. Direct capture from \u003ccode\u003efetch\u003c/code\u003e and \u003ccode\u003eXMLHttpRequest\u003c/code\u003e.\n\u003c/p\u003e\n\n## Preview\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/twinedo/rn-netinspect/6411701027319155e3ef817dc7a42a0d76fe8b34/assets/readme/preview-dashboard.svg\" alt=\"NetInspect dashboard preview\" width=\"100%\" /\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/twinedo/rn-netinspect/6411701027319155e3ef817dc7a42a0d76fe8b34/assets/readme/preview-routing.svg\" alt=\"NetInspect device routing preview\" width=\"100%\" /\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Why This Exists\n\n- See request method, URL, headers, body, status, duration, and response payload in one place.\n- Works across iOS Simulator, Android Emulator, USB-connected Android devices, and Wi-Fi-connected real devices.\n- Supports direct client capture, Android emulator proxy flow, and Android real-device `adb reverse` flow.\n- Keeps setup local: run one server on your machine and inspect requests from your app immediately.\n\n## Install\n\n```bash\nnpm install -D @twinedo/rn-netinspect\n```\n\n## Quick Start\n\nThis is the simplest setup for both iOS Simulator and Android Emulator.\n\n### 1. Add it once at app startup\n\nUse this in development mode:\n\n```js\nif (__DEV__) {\n  void import(\"@twinedo/rn-netinspect\").then(({ installRNNetInspect }) =\u003e {\n    installRNNetInspect({\n      appName: \"My RN App\",\n      // inspectorUrl: \"http://10.0.2.2:19826\", // Android emulator reaches the host machine through 10.0.2.2.\n    });\n  });\n}\n```\n\nWhy this setup:\n- works in stricter ESLint setups without disabling rules\n- keeps the library development-only\n- usually works for both Simulator and Emulator without extra setup\n- if Android Emulator does not connect automatically, uncomment `inspectorUrl`\n\n### 2. Start the server\n\n```bash\nnpx rn-netinspect-server\n```\n\n### 3. Open the dashboard\n\n```txt\nhttp://localhost:19826\n```\n\n### 4. Run your app\n\n- iOS: `npm run ios`\n- Android: `npm run android`\n\nThen trigger requests in the app and watch them appear in the dashboard.\n\n## If You Need Extra Setup\n\nMost developers should start with the quick start above first.\n\n### Android Emulator\n\nIf the Android Emulator does not connect, uncomment this line:\n\n```js\ninspectorUrl: \"http://10.0.2.2:19826\", // Android emulator reaches the host machine through 10.0.2.2.\n```\n\n`10.0.2.2` is how the Android Emulator reaches your computer.\n\n### Real Devices\n\nReal devices may need a manual `inspectorUrl`.\n\n- iPhone over Wi-Fi: `http://\u003cyour-computer-lan-ip\u003e:19826`\n- Android over Wi-Fi: `http://\u003cyour-computer-lan-ip\u003e:19826`\n- Android over USB: use `adb reverse tcp:19826 tcp:19826`\n\nIf you want the server to auto-manage `adb reverse` for physical Android devices, run:\n\n```bash\nnpx rn-netinspect-server --auto-connect\n```\n\n### Android Proxy Warning\n\nAndroid proxy mode changes global device network settings.\nThis can affect the whole emulator or phone, not just your app.\n\nUse proxy mode only when you really need it.\n\nTo clear old Android proxy settings:\n\n```bash\nadb shell settings put global http_proxy :0\nadb shell settings put global https_proxy :0\nadb shell settings delete global http_proxy\nadb shell settings delete global https_proxy\nadb shell settings delete global global_http_proxy_host\nadb shell settings delete global global_http_proxy_port\nadb shell settings delete global global_http_proxy_exclusion_list\n```\n\n### If It Still Does Not Connect\n\nIf the dashboard opens but no requests appear:\n\n- start the server before launching or reloading the app\n- reload the app after the server is already running\n- on Android Emulator, uncomment `inspectorUrl: \"http://10.0.2.2:19826\"`\n- on real devices, make sure the device can reach your computer\n\n## Options\n\n```js\ninstallRNNetInspect({\n  inspectorUrl: \"http://127.0.0.1:19826\",\n  appName: \"My RN App\",\n  captureBodies: true,\n  patchFetch: true,\n  patchXHR: true,\n  patchConsole: true,    // capture console.log/warn/error (default: true)\n});\n```\n\n## Console Viewer\n\nReact Native NetInspect can also capture `console.log`, `console.warn`, and `console.error` calls from your app and display them in the dashboard.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/twinedo/rn-netinspect/main/assets/readme/preview-console.png\" alt=\"React Native NetInspect Console\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n### How it works\n\nWhen enabled (default), the library patches `console.log`, `console.warn`, and `console.error` at the global level. Each call is buffered and sent to the server in batches (every 500ms or when 50 logs accumulate), then broadcast live to the dashboard via WebSocket.\n\n### Using the Console Viewer\n\n1. Open the dashboard at `http://localhost:19826`\n2. Click **📋 Console** in the topbar to switch from Network view to Console view\n3. Console logs from your app appear in real-time with colored level badges (cyan=log, orange=warn, red=error)\n4. Use the filter buttons (ALL / LOG / WARN / ERROR) and search box to find specific messages\n5. Click the **📋** copy button on any log entry to copy its text\n6. Toggle **Auto-scroll** to follow new logs as they arrive\n\n### Batching\n\nConsole logs are batched on the device to reduce HTTP requests:\n- Logs are buffered and flushed every **500ms**\n- Up to **50 logs** per batch request\n- Pending logs are flushed when the inspector is uninstalled\n\n### Disable console capture\n\n```js\ninstallRNNetInspect({\n  patchConsole: false,  // disable console.log/warn/error capture\n});\n```\n\n## Server API\n\n### Network events\n\nThe client sends network events to:\n\n```txt\nPOST /api/ingest\n```\n\n### Console events\n\nConsole log entries are sent in batches:\n\n```txt\nPOST /api/console/ingest\n```\n\nBody format (batch):\n```json\n{\n  \"entries\": [\n    { \"level\": \"log\", \"messages\": [\"Hello\", \"world\"], \"timestamp\": 1700000000000 },\n    { \"level\": \"warn\", \"messages\": [\"Warning message\"], \"timestamp\": 1700000001000 }\n  ],\n  \"appName\": \"My RN App\",\n  \"platform\": \"ios\",\n  \"runtimeHost\": \"localhost\",\n  \"installId\": \"install-...\"\n}\n```\n\nBody format (single entry, backward compatible):\n```json\n{\n  \"level\": \"log\",\n  \"messages\": [\"Hello\", \"world\"],\n  \"appName\": \"My RN App\",\n  \"platform\": \"ios\",\n  \"runtimeHost\": \"localhost\"\n}\n```\n\nThe dashboard also uses:\n\n```txt\nGET  /api/health\nPOST /api/register\nPOST /api/console/clear\n```\n\n## Troubleshooting\n\n### The dashboard opens, but no requests appear\n\n- make sure the app points to the correct `inspectorUrl`\n- reload the app after the server is already running\n- on physical devices, verify the phone can open the same URL in its browser\n\n### Android app says it cannot connect to `127.0.0.1:8899`\n\nThat is proxy configuration, not the direct client.\n\n- On an emulator, prefer the direct client URL `http://10.0.2.2:19826`\n- On a real device, prefer `adb reverse` or a LAN IP\n- Clear any old Android global proxy settings if necessary\n\n### Android phone has Wi-Fi but no internet after testing\n\nClear Android proxy settings:\n\n```bash\nadb shell settings put global http_proxy :0\nadb shell settings put global https_proxy :0\nadb shell settings delete global http_proxy\nadb shell settings delete global https_proxy\n```\n\nThen check the phone Wi-Fi settings and ensure proxy is disabled.\n\n## Log Colors\n\nReact Native NetInspect logs use a colored `[RN NetInspect]` prefix.\n\nTo disable colors:\n- set `NO_COLOR=1`, or\n- set `global.__RN_INSPECTOR_NO_COLOR__ = true` before calling `installRNNetInspect()`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwinedo%2Frn-netinspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwinedo%2Frn-netinspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwinedo%2Frn-netinspect/lists"}