react-native-inapp-inspector 1.1.14 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +133 -151
  2. package/dist/commonjs/assets/svgAssets.d.ts +3 -0
  3. package/dist/commonjs/assets/svgAssets.js +17 -0
  4. package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
  5. package/dist/commonjs/components/AnalyticsEventCard.js +34 -51
  6. package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
  7. package/dist/commonjs/components/AnalyticsGraph.js +8 -8
  8. package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
  9. package/dist/commonjs/components/AnalyticsTabView.js +157 -0
  10. package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
  11. package/dist/commonjs/components/AnimatedEntrance.js +2 -2
  12. package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
  13. package/dist/commonjs/components/ApiDetailView.js +304 -0
  14. package/dist/commonjs/components/ApisTabView.d.ts +33 -0
  15. package/dist/commonjs/components/ApisTabView.js +235 -0
  16. package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
  17. package/dist/commonjs/components/CodeSnippet.js +34 -34
  18. package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
  19. package/dist/commonjs/components/ConsoleLogCard.js +262 -442
  20. package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
  21. package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
  22. package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
  23. package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
  24. package/dist/commonjs/components/CopyButton.d.ts +1 -1
  25. package/dist/commonjs/components/CopyButton.js +4 -4
  26. package/dist/commonjs/components/DiffViewer.js +4 -2
  27. package/dist/commonjs/components/DomainHeader.js +66 -41
  28. package/dist/commonjs/components/EmptyState.d.ts +2 -2
  29. package/dist/commonjs/components/EmptyState.js +2 -2
  30. package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
  31. package/dist/commonjs/components/EndOfListFooter.js +89 -0
  32. package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
  33. package/dist/commonjs/components/ErrorBoundary.js +28 -28
  34. package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
  35. package/dist/commonjs/components/FloatingBubble.js +75 -0
  36. package/dist/commonjs/components/HeadersSection.js +5 -3
  37. package/dist/commonjs/components/HighlightText.d.ts +1 -1
  38. package/dist/commonjs/components/HighlightText.js +5 -7
  39. package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
  40. package/dist/commonjs/components/Inspector/AnalyticsTab.js +231 -0
  41. package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
  42. package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
  43. package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
  44. package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
  45. package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
  46. package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
  47. package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
  48. package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
  49. package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
  50. package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
  51. package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
  52. package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
  53. package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
  54. package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
  55. package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
  56. package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
  57. package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
  58. package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
  59. package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
  60. package/dist/commonjs/components/Inspector/NetworkTab.js +282 -0
  61. package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
  62. package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
  63. package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
  64. package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
  65. package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
  66. package/dist/commonjs/components/Inspector/TabBar.js +95 -0
  67. package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
  68. package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
  69. package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
  70. package/dist/commonjs/components/InspectorHeader.js +329 -0
  71. package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
  72. package/dist/commonjs/components/InspectorTabBar.js +90 -0
  73. package/dist/commonjs/components/JsonViewer.d.ts +5 -2
  74. package/dist/commonjs/components/JsonViewer.js +111 -172
  75. package/dist/commonjs/components/LogCard.js +109 -86
  76. package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
  77. package/dist/commonjs/components/MetaAccordion.js +23 -21
  78. package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
  79. package/dist/commonjs/components/NavigationTracker.js +76 -0
  80. package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
  81. package/dist/commonjs/components/NetworkIcons.js +54 -8
  82. package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
  83. package/dist/commonjs/components/ReduxTabView.js +56 -0
  84. package/dist/commonjs/components/ReduxTreeView.d.ts +2 -2
  85. package/dist/commonjs/components/ReduxTreeView.js +243 -203
  86. package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
  87. package/dist/commonjs/components/SegmentedTabs.js +52 -0
  88. package/dist/commonjs/components/SettingsView.d.ts +13 -0
  89. package/dist/commonjs/components/SettingsView.js +328 -0
  90. package/dist/commonjs/components/TouchableScale.d.ts +2 -2
  91. package/dist/commonjs/components/TouchableScale.js +2 -2
  92. package/dist/commonjs/components/TreeNode.js +2 -2
  93. package/dist/commonjs/constants/index.js +1 -12
  94. package/dist/commonjs/constants/version.d.ts +1 -1
  95. package/dist/commonjs/constants/version.js +1 -1
  96. package/dist/commonjs/customHooks/consoleLogger.js +137 -13
  97. package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
  98. package/dist/commonjs/customHooks/networkLogger.js +0 -1
  99. package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
  100. package/dist/commonjs/enums/index.d.ts +39 -0
  101. package/dist/commonjs/enums/index.js +50 -0
  102. package/dist/commonjs/helpers/index.d.ts +27 -1
  103. package/dist/commonjs/helpers/index.js +187 -12
  104. package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
  105. package/dist/commonjs/i18n/en.json +144 -0
  106. package/dist/commonjs/i18n/index.d.ts +2 -0
  107. package/dist/commonjs/i18n/index.js +27 -0
  108. package/dist/commonjs/i18n/locales/en.json +314 -0
  109. package/dist/commonjs/index.d.ts +1 -2
  110. package/dist/commonjs/index.js +196 -4800
  111. package/dist/commonjs/styles/AppColors.d.ts +148 -0
  112. package/dist/commonjs/styles/AppColors.js +176 -0
  113. package/dist/commonjs/styles/common.d.ts +3 -0
  114. package/dist/commonjs/styles/common.js +201 -0
  115. package/dist/commonjs/styles/index.d.ts +167 -442
  116. package/dist/commonjs/styles/index.js +239 -471
  117. package/dist/commonjs/types/enums.d.ts +9 -0
  118. package/dist/commonjs/types/enums.js +4 -0
  119. package/dist/commonjs/types/index.d.ts +4 -111
  120. package/dist/commonjs/types/index.js +16 -0
  121. package/dist/commonjs/types/interfaces.d.ts +337 -0
  122. package/dist/commonjs/types/interfaces.js +2 -0
  123. package/dist/esm/assets/svgAssets.d.ts +3 -0
  124. package/dist/esm/assets/svgAssets.js +14 -0
  125. package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
  126. package/dist/esm/components/AnalyticsEventCard.js +32 -49
  127. package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
  128. package/dist/esm/components/AnalyticsGraph.js +8 -8
  129. package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
  130. package/dist/esm/components/AnalyticsTabView.js +151 -0
  131. package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
  132. package/dist/esm/components/AnimatedEntrance.js +2 -2
  133. package/dist/esm/components/ApiDetailView.d.ts +22 -0
  134. package/dist/esm/components/ApiDetailView.js +264 -0
  135. package/dist/esm/components/ApisTabView.d.ts +33 -0
  136. package/dist/esm/components/ApisTabView.js +196 -0
  137. package/dist/esm/components/CodeSnippet.d.ts +1 -5
  138. package/dist/esm/components/CodeSnippet.js +34 -34
  139. package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
  140. package/dist/esm/components/ConsoleLogCard.js +262 -409
  141. package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
  142. package/dist/esm/components/ConsoleLogDetailView.js +271 -0
  143. package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
  144. package/dist/esm/components/ConsoleLogsTabView.js +348 -0
  145. package/dist/esm/components/CopyButton.d.ts +1 -1
  146. package/dist/esm/components/CopyButton.js +5 -5
  147. package/dist/esm/components/DiffViewer.js +4 -2
  148. package/dist/esm/components/DomainHeader.js +66 -41
  149. package/dist/esm/components/EmptyState.d.ts +2 -2
  150. package/dist/esm/components/EmptyState.js +2 -2
  151. package/dist/esm/components/EndOfListFooter.d.ts +8 -0
  152. package/dist/esm/components/EndOfListFooter.js +83 -0
  153. package/dist/esm/components/ErrorBoundary.d.ts +5 -14
  154. package/dist/esm/components/ErrorBoundary.js +29 -29
  155. package/dist/esm/components/FloatingBubble.d.ts +14 -0
  156. package/dist/esm/components/FloatingBubble.js +68 -0
  157. package/dist/esm/components/HeadersSection.js +5 -3
  158. package/dist/esm/components/HighlightText.d.ts +1 -1
  159. package/dist/esm/components/HighlightText.js +5 -7
  160. package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
  161. package/dist/esm/components/Inspector/AnalyticsTab.js +193 -0
  162. package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
  163. package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
  164. package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
  165. package/dist/esm/components/Inspector/FabLauncher.js +49 -0
  166. package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
  167. package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
  168. package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
  169. package/dist/esm/components/Inspector/InspectorContext.js +13 -0
  170. package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
  171. package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
  172. package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
  173. package/dist/esm/components/Inspector/LogDetail.js +925 -0
  174. package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
  175. package/dist/esm/components/Inspector/MainScreen.js +63 -0
  176. package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
  177. package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
  178. package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
  179. package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
  180. package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
  181. package/dist/esm/components/Inspector/NetworkTab.js +244 -0
  182. package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
  183. package/dist/esm/components/Inspector/ReduxTab.js +70 -0
  184. package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
  185. package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
  186. package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
  187. package/dist/esm/components/Inspector/TabBar.js +90 -0
  188. package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
  189. package/dist/esm/components/Inspector/WebViewTab.js +752 -0
  190. package/dist/esm/components/InspectorHeader.d.ts +19 -0
  191. package/dist/esm/components/InspectorHeader.js +323 -0
  192. package/dist/esm/components/InspectorTabBar.d.ts +16 -0
  193. package/dist/esm/components/InspectorTabBar.js +84 -0
  194. package/dist/esm/components/JsonViewer.d.ts +5 -2
  195. package/dist/esm/components/JsonViewer.js +112 -173
  196. package/dist/esm/components/LogCard.js +111 -88
  197. package/dist/esm/components/MetaAccordion.d.ts +1 -10
  198. package/dist/esm/components/MetaAccordion.js +23 -21
  199. package/dist/esm/components/NavigationTracker.d.ts +7 -0
  200. package/dist/esm/components/NavigationTracker.js +39 -0
  201. package/dist/esm/components/NetworkIcons.d.ts +6 -0
  202. package/dist/esm/components/NetworkIcons.js +46 -6
  203. package/dist/esm/components/ReduxTabView.d.ts +9 -0
  204. package/dist/esm/components/ReduxTabView.js +50 -0
  205. package/dist/esm/components/ReduxTreeView.d.ts +2 -2
  206. package/dist/esm/components/ReduxTreeView.js +245 -204
  207. package/dist/esm/components/SegmentedTabs.d.ts +15 -0
  208. package/dist/esm/components/SegmentedTabs.js +47 -0
  209. package/dist/esm/components/SettingsView.d.ts +13 -0
  210. package/dist/esm/components/SettingsView.js +321 -0
  211. package/dist/esm/components/TouchableScale.d.ts +2 -2
  212. package/dist/esm/components/TouchableScale.js +2 -2
  213. package/dist/esm/components/TreeNode.js +2 -2
  214. package/dist/esm/constants/index.js +1 -12
  215. package/dist/esm/constants/version.d.ts +1 -1
  216. package/dist/esm/constants/version.js +1 -1
  217. package/dist/esm/customHooks/consoleLogger.js +137 -13
  218. package/dist/esm/customHooks/networkLogger.d.ts +0 -1
  219. package/dist/esm/customHooks/networkLogger.js +0 -1
  220. package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
  221. package/dist/esm/enums/index.d.ts +39 -0
  222. package/dist/esm/enums/index.js +47 -0
  223. package/dist/esm/helpers/index.d.ts +27 -1
  224. package/dist/esm/helpers/index.js +180 -11
  225. package/dist/esm/helpers/settingsStore.d.ts +2 -24
  226. package/dist/esm/i18n/en.json +144 -0
  227. package/dist/esm/i18n/index.d.ts +2 -0
  228. package/dist/esm/i18n/index.js +22 -0
  229. package/dist/esm/i18n/locales/en.json +314 -0
  230. package/dist/esm/index.d.ts +1 -2
  231. package/dist/esm/index.js +200 -4796
  232. package/dist/esm/styles/AppColors.d.ts +148 -0
  233. package/dist/esm/styles/AppColors.js +176 -0
  234. package/dist/esm/styles/common.d.ts +3 -0
  235. package/dist/esm/styles/common.js +197 -0
  236. package/dist/esm/styles/index.d.ts +167 -442
  237. package/dist/esm/styles/index.js +239 -471
  238. package/dist/esm/types/enums.d.ts +9 -0
  239. package/dist/esm/types/enums.js +3 -0
  240. package/dist/esm/types/index.d.ts +4 -111
  241. package/dist/esm/types/index.js +2 -1
  242. package/dist/esm/types/interfaces.d.ts +337 -0
  243. package/dist/esm/types/interfaces.js +1 -0
  244. package/example/App.tsx +145 -2
  245. package/example/README.md +33 -77
  246. package/package.json +3 -1
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
  <a href="https://github.com/vengatmacuser/react-native-inapp-inspector"><img src="https://img.shields.io/badge/platform-iOS%20%7C%20Android-blue" alt="platform" /></a>
15
15
  </p>
16
16
 
17
- A self-contained in-app debugging overlay for React Native. Inspect network traffic, console output, analytics events, Redux state, and WebView activity directly inside your app.
17
+ A self-contained, developer-first in-app debugging overlay for React Native. Inspect network traffic, console logs, stack traces, analytics events, and Redux state directly on your device or simulator with zero external dependencies.
18
18
 
19
19
  <p align="center">
20
20
  <img src="https://raw.githubusercontent.com/vengatmacuser/react-native-inapp-inspector/main/assets/walkthrough.gif" alt="React Native In-App Inspector Walkthrough" width="360" style="border-radius: 20px;" />
@@ -22,27 +22,27 @@ A self-contained in-app debugging overlay for React Native. Inspect network traf
22
22
 
23
23
  ---
24
24
 
25
- ## Features
25
+ ## Features
26
26
 
27
- | Feature | Description |
28
- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
- | Network inspector | Captures `fetch` and axios `GET`, `POST`, `PUT`, `PATCH`, and `DELETE` calls with URL, method, status, headers, body, response, duration, caller, cURL, and fetch snippets. |
30
- | Insights dashboard | Shows request totals, status breakdowns, latency, payload size, slow requests, and recent activity charts. |
31
- | Console logger | Captures `console.log`, `console.info`, `console.warn`, and `console.error` with source method and caller details. |
32
- | Analytics tracker | Captures manual analytics events and patched `@react-native-firebase/analytics` calls including `logEvent`, `logScreenView`, user properties, and user id. |
33
- | Redux inspector | Connects to a Redux store, displays the live state tree, tracks dispatched actions, affected slices, and action history. |
34
- | WebView inspector | Provides an instrumented `WebView` with console capture, navigation history, HTML/CSS/JS snapshots, and optional loading overlay. |
35
- | Error boundary | Exports an `ErrorBoundary` for catching React errors and wrapping the inspector safely. |
27
+ | Feature | Description |
28
+ | --- | --- |
29
+ | 🌐 **Network Inspector** | Intercepts `fetch` and Axios (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`). Inspect status codes, request/response headers, body JSON, duration, caller origin, and instant cURL / fetch export snippets. |
30
+ | 🪵 **Console Logger & Stack Trace** | Captures `console.log`, `info`, `warn`, and `error`. Displays trigger file (`TSX`, `JSX`, `TS`, `JS`) & line numbers via **Metro Symbolication**, call stack frames, individual arguments inspection, and duplicate collapsing (`×N`). |
31
+ | ⏸️ **Live Stream Pause / Resume** | Freeze incoming network requests, console logs, and analytics streams on the fly to inspect active traffic without list jumping. |
32
+ | 📊 **Analytics Tracker** | Tracks manual events and auto-patches `@react-native-firebase/analytics` calls (`logEvent`, `logScreenView`, `setUserProperties`, and `setUserId`). |
33
+ | 🔄 **Redux State & Actions** | Connects to Redux / Redux Toolkit. Inspect dispatched actions with deep state diffs, payload breakdown, slice state trees, and `redux-persist` metadata. |
34
+ | 🪟 **Rich JSON Viewer** | Explore data in **Pretty**, **Raw**, and **Table** modes with full-text search highlighting and uniform typography. |
35
+ | 🛡️ **Error Boundary** | Built-in `ErrorBoundary` to gracefully catch and inspect React render crashes. |
36
36
 
37
37
  ---
38
38
 
39
- ## Video Walkthrough
39
+ ## 🎬 Video Walkthrough
40
40
 
41
41
  [Download or watch the Video Walkthrough](https://raw.githubusercontent.com/vengatmacuser/react-native-inapp-inspector/main/example/guidance/Video-WalkThrough.mp4)
42
42
 
43
43
  ---
44
44
 
45
- ## Installation
45
+ ## 📦 Installation
46
46
 
47
47
  ```bash
48
48
  npm install --save-dev react-native-inapp-inspector axios
@@ -52,25 +52,22 @@ npm install --save-dev react-native-inapp-inspector axios
52
52
  yarn add -D react-native-inapp-inspector axios
53
53
  ```
54
54
 
55
- The package has React and React Native as peer dependencies. It depends on `@react-navigation/native`, `react-native-linear-gradient`, and `react-native-svg`. The current network logger imports `axios` for axios interception, so install `axios` even if most of your requests use `fetch`.
55
+ ### Peer & Native Dependencies
56
56
 
57
- Install optional integrations when you use WebView or Firebase Analytics capture:
57
+ The package has React and React Native as peer dependencies. It depends on `@react-navigation/native`, `react-native-linear-gradient`, and `react-native-svg`.
58
58
 
59
- ```bash
60
- npm install react-native-webview @react-native-firebase/analytics
61
- ```
62
-
63
- For iOS, install pods after adding native dependencies:
59
+ *(Optional)* If you use `@react-native-clipboard/clipboard` in your project, the inspector automatically detects and utilizes native clipboard bridges for seamless emulator-to-host copying.
64
60
 
65
61
  ```bash
62
+ # iOS Pods installation
66
63
  cd ios && pod install
67
64
  ```
68
65
 
69
66
  ---
70
67
 
71
- ## Basic Setup
68
+ ## 🚀 Basic Setup
72
69
 
73
- Mount the inspector once near the root of your app.
70
+ Mount `<NetworkInspector />` near the root of your application:
74
71
 
75
72
  ```tsx
76
73
  import React from 'react';
@@ -80,7 +77,7 @@ import NetworkInspector from 'react-native-inapp-inspector';
80
77
  const App = () => {
81
78
  return (
82
79
  <SafeAreaView style={{flex: 1}}>
83
- {/* Your app */}
80
+ {/* Your application components */}
84
81
  <NetworkInspector />
85
82
  </SafeAreaView>
86
83
  );
@@ -89,71 +86,59 @@ const App = () => {
89
86
  export default App;
90
87
  ```
91
88
 
92
- When mounted, the inspector sets up network logging, clears previous network logs, patches console logging, and attempts Firebase Analytics auto-setup if `@react-native-firebase/analytics` is installed.
89
+ When mounted, the inspector automatically sets up network logging, intercepts console methods, and attaches Firebase Analytics if available.
93
90
 
94
- If you need to capture requests that happen before the component mounts, call `setupNetworkLogger()` at module level in your app entry file.
91
+ ### Early Startup Network Logging
92
+
93
+ If your application makes API calls before the root component finishes mounting, initialize the logger at the module level in your entry file (`index.js` or `App.tsx`):
95
94
 
96
95
  ```tsx
97
96
  import NetworkInspector, {
98
97
  setupNetworkLogger,
98
+ setupConsoleLogger,
99
99
  } from 'react-native-inapp-inspector';
100
100
 
101
101
  setupNetworkLogger();
102
+ setupConsoleLogger();
102
103
  ```
103
104
 
104
- You can disable the overlay without removing it from your tree:
105
-
106
- ```tsx
107
- <NetworkInspector enabled={false} />
108
- ```
109
-
110
- ---
111
-
112
- ## Settings Persistence
105
+ ### Toggling Visibility
113
106
 
114
- By default, the inspector preserves configuration preferences (such as dark mode, default landing tab, and module visibilities):
115
- - **iOS:** Settings are persisted automatically using React Native's built-in `Settings` module (`NSUserDefaults`) with zero configuration or additional packages required.
116
- - **Android / Custom:** To persist settings on Android (or to use a custom storage mechanism on both platforms), pass a storage instance such as `@react-native-async-storage/async-storage` or `react-native-mmkv` to the `storage` prop:
107
+ You can disable or hide the floating launcher overlay conditionally:
117
108
 
118
109
  ```tsx
119
- import AsyncStorage from '@react-native-async-storage/async-storage';
110
+ // Fully disable the overlay and interception
111
+ <NetworkInspector enabled={__DEV__} />
120
112
 
121
- <NetworkInspector storage={AsyncStorage} />
113
+ // Hide the floating trigger button while keeping background interception active
114
+ <NetworkInspector isEnabled={false} />
122
115
  ```
123
116
 
124
- If no `storage` prop is passed, Android will fall back to an in-memory store (settings reset when the app is restarted).
125
-
126
117
  ---
127
118
 
128
- ## Navigation & Screen Tracking
119
+ ## 🪵 Console Logger & Stack Trace
129
120
 
130
- To group network requests, console logs, and analytics events by the specific navigation screen where they occurred, the inspector automatically hooks into React Navigation context.
121
+ The console logger provides deep insight into every `console.log`, `info`, `warn`, and `error` call:
131
122
 
132
- If you mount `<NetworkInspector />` globally at the root of your application (outside of the `<NavigationContainer>`), it won't have access to React Navigation's context. To enable accurate screen tracking in this setup, create a navigation ref and pass it to the `navigationRef` prop:
123
+ - **Metro Source Map Symbolication**: In development mode, stack traces are automatically symbolicated against Metro to point directly to your exact project source files (`HomeScreen.tsx:42:15`, `App.tsx:20`).
124
+ - **File Type Badges**: Distinct visual chips identifying `.tsx`, `.jsx`, `.ts`, and `.js` callers.
125
+ - **Detailed Sub-Tabs**:
126
+ - **Output / Message**: Full message with JSON Viewer (Pretty, Raw, Table modes) and link detection.
127
+ - **Args (N)**: Inspect each passed argument individually with type detection (`Array[5]`, `Object{4}`).
128
+ - **Call Stack Trace**: Structured frame cards (with Frame `#`, Function, File, and `L:C` pills) and Raw Trace view.
129
+ - **Error Stack**: Automatically captures the thrown Error stack trace when logging Error objects.
130
+ - **Metadata**: Structured table of log properties, timestamp, character count, and duplicate counter.
133
131
 
134
132
  ```tsx
135
- import { NavigationContainer, createNavigationContainerRef } from '@react-navigation/native';
136
- import NetworkInspector from 'react-native-inapp-inspector';
137
-
138
- const navigationRef = createNavigationContainerRef();
139
-
140
- const App = () => {
141
- return (
142
- <>
143
- <NavigationContainer ref={navigationRef}>
144
- {/* Navigators / Screens */}
145
- </NavigationContainer>
146
- <NetworkInspector navigationRef={navigationRef} />
147
- </>
148
- );
149
- };
133
+ console.log('[API] User authenticated successfully', {userId: 42, role: 'admin'});
134
+ console.error(new Error('Payment gateway timeout'));
150
135
  ```
151
136
 
152
137
  ---
153
138
 
154
- ## Network Logging
139
+ ## 🌐 Network Logging
155
140
 
156
- `setupNetworkLogger()` patches global `fetch`, the default axios instance, and future axios instances created with `axios.create()`.
141
+ `setupNetworkLogger()` intercepts global `fetch`, the default Axios instance, and instances created with `axios.create()`.
157
142
 
158
143
  ```tsx
159
144
  import axios from 'axios';
@@ -167,7 +152,7 @@ await fetch('https://api.example.com/users');
167
152
  await api.post('/login', {email, password});
168
153
  ```
169
154
 
170
- If an axios instance was created before `setupNetworkLogger()` ran, attach interceptors manually:
155
+ If an Axios instance was instantiated before `setupNetworkLogger()` ran, attach interceptors manually:
171
156
 
172
157
  ```tsx
173
158
  import {addAxiosInterceptors} from 'react-native-inapp-inspector';
@@ -175,27 +160,46 @@ import {addAxiosInterceptors} from 'react-native-inapp-inspector';
175
160
  addAxiosInterceptors(api);
176
161
  ```
177
162
 
178
- Network logs are capped at 100 entries and ignore React Native symbolication requests.
179
-
180
163
  ---
181
164
 
182
- ## Console Logging
165
+ ## 🔄 Redux State & Action Inspection
183
166
 
184
- The inspector captures console output automatically when mounted. You can also set it up manually:
167
+ Connect your Redux store once during application startup:
185
168
 
186
169
  ```tsx
187
- import {setupConsoleLogger} from 'react-native-inapp-inspector';
170
+ import {connectReduxStore} from 'react-native-inapp-inspector';
171
+ import store from './store';
188
172
 
189
- setupConsoleLogger();
173
+ connectReduxStore(store);
174
+ ```
175
+
176
+ ### RTK Query, Thunks & Sagas (Recommended)
177
+
178
+ To capture actions dispatched from inside async thunks, sagas, or RTK Query, add `inspectorReduxMiddleware`:
179
+
180
+ ```tsx
181
+ import {configureStore} from '@reduxjs/toolkit';
182
+ import {inspectorReduxMiddleware, connectReduxStore} from 'react-native-inapp-inspector';
183
+ import rootReducer from './slices';
184
+
185
+ const store = configureStore({
186
+ reducer: rootReducer,
187
+ middleware: getDefaultMiddleware =>
188
+ getDefaultMiddleware().concat(inspectorReduxMiddleware),
189
+ });
190
+
191
+ connectReduxStore(store);
190
192
  ```
191
193
 
192
- Captured levels are `log`, `info`, `warn`, and `error`.
194
+ The Redux tab provides:
195
+ - **Action History**: Action type badge, timestamp, payload size, affected slices, deep state diffs, and snapshot viewer.
196
+ - **Slice Tree**: Live state tree per slice, persisted slice detection (`_persist`), search filtering, and JSON table exploration.
193
197
 
194
198
  ---
195
199
 
196
- ## Analytics Logging
200
+ ## 📊 Analytics Logging
197
201
 
198
- Manual events can be pushed into the Analytics tab:
202
+ Log manual analytics events or connect Firebase Analytics:
199
203
 
200
204
  ```tsx
201
205
  import {logAnalyticsEvent} from 'react-native-inapp-inspector';
@@ -207,7 +211,7 @@ logAnalyticsEvent('purchase_completed', {
207
211
  });
208
212
  ```
209
213
 
210
- For Firebase Analytics, pass the result of `analytics()` to `setupAnalyticsLogger()` before analytics calls begin:
214
+ ### Firebase Analytics Integration
211
215
 
212
216
  ```tsx
213
217
  import analytics from '@react-native-firebase/analytics';
@@ -216,109 +220,89 @@ import {setupAnalyticsLogger} from 'react-native-inapp-inspector';
216
220
  setupAnalyticsLogger(analytics());
217
221
  ```
218
222
 
219
- The logger patches `logEvent`, `logScreenView`, `setUserProperty`, `setUserProperties`, and `setUserId`. Analytics events are capped at 200 entries.
220
-
221
223
  ---
222
224
 
223
- ## Redux Inspection
225
+ ## 🧭 Navigation & Screen Tracking
224
226
 
225
- Connect your Redux store once during app startup.
227
+ To group network requests, logs, and analytics by the active screen, pass your navigation container ref:
226
228
 
227
229
  ```tsx
228
- import {connectReduxStore} from 'react-native-inapp-inspector';
229
- import store from './store';
230
-
231
- connectReduxStore(store);
232
- ```
233
-
234
- **Recommended:** if you use thunks, sagas or RTK Query, also add the inspector middleware so actions dispatched from inside them are captured with full type/payload attribution (they bypass the wrapped outer dispatch otherwise):
230
+ import {NavigationContainer, createNavigationContainerRef} from '@react-navigation/native';
231
+ import NetworkInspector from 'react-native-inapp-inspector';
235
232
 
236
- ```tsx
237
- import {inspectorReduxMiddleware} from 'react-native-inapp-inspector';
233
+ const navigationRef = createNavigationContainerRef();
238
234
 
239
- const store = configureStore({
240
- reducer,
241
- middleware: getDefaultMiddleware =>
242
- getDefaultMiddleware().concat(inspectorReduxMiddleware),
243
- });
235
+ const App = () => {
236
+ return (
237
+ <>
238
+ <NavigationContainer ref={navigationRef}>
239
+ {/* Your screens */}
240
+ </NavigationContainer>
241
+ <NetworkInspector navigationRef={navigationRef} />
242
+ </>
243
+ );
244
+ };
244
245
  ```
245
246
 
246
- Using both together is safe — they de-duplicate automatically.
247
-
248
- The Redux tab shows the latest state tree, recent dispatches, payloads, and changed top-level state slices. Action history is capped at 50 entries.
249
-
250
247
  ---
251
248
 
252
- ## WebView Inspection
249
+ ## ⚙️ Settings Persistence
253
250
 
254
- Use the exported `WebView` as a drop-in wrapper around `react-native-webview`.
251
+ Inspector preferences (dark mode, active modules, default landing tab) persist across app launches:
252
+ - **iOS**: Uses React Native's built-in `Settings` module (`NSUserDefaults`) with zero extra configuration.
253
+ - **Android / Custom Storage**: Pass `@react-native-async-storage/async-storage` or `react-native-mmkv` to the `storage` prop:
255
254
 
256
255
  ```tsx
257
- import {WebView} from 'react-native-inapp-inspector';
258
-
259
- <WebView source={{uri: 'https://example.com'}} />;
260
- ```
261
-
262
- The wrapper forwards your props and ref, preserves your `onMessage`, `onNavigationStateChange`, `onLoadStart`, and `onLoadEnd` handlers, and injects scripts for WebView console logs, navigation history, and source snapshots.
263
-
264
- Disable the loading overlay with `showLoader={false}`:
256
+ import AsyncStorage from '@react-native-async-storage/async-storage';
265
257
 
266
- ```tsx
267
- <WebView source={{uri: 'https://example.com'}} showLoader={false} />
258
+ <NetworkInspector storage={AsyncStorage} />
268
259
  ```
269
260
 
270
261
  ---
271
262
 
272
- ## Error Boundary
263
+ ## 🛡️ Error Boundary
264
+
265
+ Catch and inspect unhandled React component render crashes:
273
266
 
274
267
  ```tsx
275
268
  import {ErrorBoundary} from 'react-native-inapp-inspector';
276
269
 
277
270
  <ErrorBoundary>
278
- <YourComponent />
279
- </ErrorBoundary>;
271
+ <YourApp />
272
+ </ErrorBoundary>
280
273
  ```
281
274
 
282
275
  ---
283
276
 
284
- ## Public API
285
-
286
- | Export | Type | Description |
287
- | --------------------------------------------------- | ----------------- | -------------------------------------------------------------------------- |
288
- | `NetworkInspector` | default component | Floating inspector overlay. Mount once near the root of the app. |
289
- | `setupNetworkLogger()` | function | Patches `fetch`, default axios, and future `axios.create()` instances. |
290
- | `addAxiosInterceptors(instance)` | function | Manually attaches axios interceptors to an existing instance. |
291
- | `clearNetworkLogs()` | function | Clears captured network logs. |
292
- | `subscribeNetworkLogs(callback)` | function | Subscribes to network log updates and returns an unsubscribe function. |
293
- | `setupConsoleLogger()` | function | Patches console methods. |
294
- | `clearConsoleLogs()` | function | Clears captured console logs. |
295
- | `subscribeConsoleLogs(callback)` | function | Subscribes to console log updates and returns an unsubscribe function. |
296
- | `setupAnalyticsLogger(instance)` | function | Patches a Firebase Analytics instance. |
297
- | `logAnalyticsEvent(name, params?, userProperties?)` | function | Adds a manual analytics event to the inspector. |
298
- | `clearAnalyticsEvents()` | function | Clears captured analytics events. |
299
- | `subscribeAnalyticsEvents(callback)` | function | Subscribes to analytics event updates and returns an unsubscribe function. |
300
- | `connectReduxStore(store)` | function | Connects a Redux store for live state and action inspection. |
301
- | `inspectorReduxMiddleware` | middleware | Redux middleware to capture actions dispatched from thunks/sagas. |
302
- | `getReduxState()` | function | Returns the latest captured Redux state. |
303
- | `subscribeReduxState(callback)` | function | Subscribes to Redux state updates and returns an unsubscribe function. |
304
- | `getActionHistory()` | function | Returns the recent dispatched Redux actions. |
305
- | `clearActionHistory()` | function | Clears the Redux action history. |
306
- | `WebView` | component | Instrumented WebView wrapper. |
307
- | `getWebViewLogs()` | function | Returns captured WebView console logs. |
308
- | `getWebViewNavHistory()` | function | Returns captured WebView navigation history. |
309
- | `getWebViewHtml()` | function | Returns the latest captured WebView HTML. |
310
- | `getWebViewCss()` | function | Returns the latest captured WebView CSS. |
311
- | `getWebViewJs()` | function | Returns the latest captured WebView JavaScript. |
312
- | `getWebViewHtmlUrl()` | function | Returns the URL for the latest captured WebView source snapshot. |
313
- | `clearWebViewData()` | function | Clears captured WebView logs, navigation, and source data. |
314
- | `subscribeWebView(callback)` | function | Subscribes to WebView data changes and returns an unsubscribe function. |
315
- | `ErrorBoundary` | component | React error boundary component. |
277
+ ## 📚 Public API Reference
278
+
279
+ | Export | Type | Description |
280
+ | --- | --- | --- |
281
+ | `NetworkInspector` | Component | Floating inspector overlay. Mount near app root. |
282
+ | `setupNetworkLogger()` | Function | Patches `fetch`, default Axios, and future `axios.create()` instances. |
283
+ | `addAxiosInterceptors(instance)` | Function | Manually attaches Axios interceptors to an existing instance. |
284
+ | `clearNetworkLogs()` | Function | Clears captured network requests. |
285
+ | `subscribeNetworkLogs(cb)` | Function | Subscribes to network log updates. |
286
+ | `setupConsoleLogger()` | Function | Intercepts `console.log`, `info`, `warn`, and `error`. |
287
+ | `clearConsoleLogs()` | Function | Clears captured console logs. |
288
+ | `subscribeConsoleLogs(cb)` | Function | Subscribes to console log updates. |
289
+ | `connectReduxStore(store)` | Function | Connects a Redux store for state and action inspection. |
290
+ | `inspectorReduxMiddleware` | Middleware | Redux middleware for capturing thunks, sagas, and RTK Query actions. |
291
+ | `getReduxState()` | Function | Returns the current captured Redux state snapshot. |
292
+ | `subscribeReduxState(cb)` | Function | Subscribes to Redux state changes. |
293
+ | `getActionHistory()` | Function | Returns the history of dispatched Redux actions. |
294
+ | `clearActionHistory()` | Function | Clears Redux action history. |
295
+ | `setupAnalyticsLogger(instance)` | Function | Patches a Firebase Analytics instance. |
296
+ | `logAnalyticsEvent(name, params?, userProps?)` | Function | Logs a manual analytics event. |
297
+ | `clearAnalyticsEvents()` | Function | Clears captured analytics events. |
298
+ | `subscribeAnalyticsEvents(cb)` | Function | Subscribes to analytics event updates. |
299
+ | `ErrorBoundary` | Component | React error boundary component. |
316
300
 
317
301
  ---
318
302
 
319
- ## Example App
303
+ ## 📱 Example App
320
304
 
321
- The `example` directory contains a React Native sample app and video walkthrough.
305
+ Check out the `example` directory for a complete demo application:
322
306
 
323
307
  ```bash
324
308
  cd example
@@ -329,17 +313,15 @@ npm run ios
329
313
 
330
314
  ---
331
315
 
332
- ## Contributing 🤝
316
+ ## 🤝 Contributing
333
317
 
334
- Contributions are welcome! Please check out our [Contributing Guidelines](CONTRIBUTING.md) to learn how to get started, set up the development environment, or request features.
318
+ Contributions are welcome! Please check out our [Contributing Guidelines](CONTRIBUTING.md) to get started.
335
319
 
336
320
  ---
337
321
 
338
- ## Support & Sponsoring 💖
339
-
340
- This library is a completely free, open-source utility maintained in the author's spare time. If this tool has saved you or your team hours of debugging, please consider supporting its continuous development.
322
+ ## 💖 Support & Sponsoring
341
323
 
342
- Sponsoring helps prioritize your bug fixes, maintain compatibility with new React Native versions, and support new features.
324
+ This library is a free, open-source utility maintained in spare time. If it saved you or your team time debugging, please consider supporting its continuous development.
343
325
 
344
326
  👉 **[Sponsor @vengatmacuser on GitHub Sponsors](https://github.com/sponsors/vengatmacuser)**
345
327
 
@@ -347,6 +329,6 @@ Sponsoring helps prioritize your bug fixes, maintain compatibility with new Reac
347
329
 
348
330
  ---
349
331
 
350
- ## License
332
+ ## 📄 License
351
333
 
352
- MIT - see the [LICENSE](LICENSE) file for details.
334
+ MIT © [vengatmacuser](LICENSE)
@@ -0,0 +1,3 @@
1
+ export declare const PRETTY_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5 3C3.9 3 3 3.9 3 5v1.5c0 .8-.7 1.5-1.5 1.5S0 7.3 0 6.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1zm6 0c-1.1 0-2 .9-2 2v1.5c0 .8-.7 1.5-1.5 1.5S6 9.3 6 8.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1z\" fill=\"currentColor\" opacity=\"0.9\"/>\n <path d=\"M3 11v1.5c0 .8.7 1.5 1.5 1.5S6 13.3 6 12.5V11H3zm7 0v1.5c0 .8.7 1.5 1.5 1.5S13 13.3 13 12.5V11H10z\" fill=\"currentColor\" opacity=\"0.6\"/>\n</svg>";
2
+ export declare const RAW_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"2\" width=\"10\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.9\"/>\n <rect x=\"1\" y=\"5.5\" width=\"14\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.6\"/>\n <rect x=\"1\" y=\"9\" width=\"8\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.45\"/>\n <rect x=\"1\" y=\"12.5\" width=\"12\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.3\"/>\n</svg>";
3
+ export declare const TABLE_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"1\" width=\"14\" height=\"14\" rx=\"2\" stroke=\"currentColor\" stroke-width=\"1.2\" opacity=\"0.7\"/>\n <path d=\"M1 5.5h14M1 10h14M5.5 1v14M10.5 1v14\" stroke=\"currentColor\" stroke-width=\"0.8\" opacity=\"0.5\"/>\n</svg>";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TABLE_SVG = exports.RAW_SVG = exports.PRETTY_SVG = void 0;
4
+ exports.PRETTY_SVG = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
5
+ <path d="M5 3C3.9 3 3 3.9 3 5v1.5c0 .8-.7 1.5-1.5 1.5S0 7.3 0 6.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1zm6 0c-1.1 0-2 .9-2 2v1.5c0 .8-.7 1.5-1.5 1.5S6 9.3 6 8.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1z" fill="currentColor" opacity="0.9"/>
6
+ <path d="M3 11v1.5c0 .8.7 1.5 1.5 1.5S6 13.3 6 12.5V11H3zm7 0v1.5c0 .8.7 1.5 1.5 1.5S13 13.3 13 12.5V11H10z" fill="currentColor" opacity="0.6"/>
7
+ </svg>`;
8
+ exports.RAW_SVG = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
9
+ <rect x="1" y="2" width="10" height="1.5" rx="0.75" fill="currentColor" opacity="0.9"/>
10
+ <rect x="1" y="5.5" width="14" height="1.5" rx="0.75" fill="currentColor" opacity="0.6"/>
11
+ <rect x="1" y="9" width="8" height="1.5" rx="0.75" fill="currentColor" opacity="0.45"/>
12
+ <rect x="1" y="12.5" width="12" height="1.5" rx="0.75" fill="currentColor" opacity="0.3"/>
13
+ </svg>`;
14
+ exports.TABLE_SVG = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
15
+ <rect x="1" y="1" width="14" height="14" rx="2" stroke="currentColor" stroke-width="1.2" opacity="0.7"/>
16
+ <path d="M1 5.5h14M1 10h14M5.5 1v14M10.5 1v14" stroke="currentColor" stroke-width="0.8" opacity="0.5"/>
17
+ </svg>`;
@@ -1,18 +1,5 @@
1
1
  import React from 'react';
2
- import { AnalyticsEvent } from '../types';
2
+ import { AnalyticsEventCardProps } from '../types';
3
3
  export declare function getEventColor(name: string): string;
4
- export interface AnalyticsEventCardProps {
5
- event: AnalyticsEvent & {
6
- count?: number;
7
- };
8
- onPress: () => void;
9
- isNew?: boolean;
10
- searchStr?: string;
11
- isFirst: boolean;
12
- isLast: boolean;
13
- msSincePrev?: number;
14
- showTimestamp?: boolean;
15
- computedScreenName?: string;
16
- }
17
4
  declare const AnalyticsEventCard: React.NamedExoticComponent<AnalyticsEventCardProps>;
18
5
  export default AnalyticsEventCard;