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.
- package/README.md +133 -151
- package/dist/commonjs/assets/svgAssets.d.ts +3 -0
- package/dist/commonjs/assets/svgAssets.js +17 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/commonjs/components/AnalyticsEventCard.js +34 -51
- package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
- package/dist/commonjs/components/AnalyticsGraph.js +8 -8
- package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
- package/dist/commonjs/components/AnalyticsTabView.js +157 -0
- package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
- package/dist/commonjs/components/AnimatedEntrance.js +2 -2
- package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
- package/dist/commonjs/components/ApiDetailView.js +304 -0
- package/dist/commonjs/components/ApisTabView.d.ts +33 -0
- package/dist/commonjs/components/ApisTabView.js +235 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
- package/dist/commonjs/components/CodeSnippet.js +34 -34
- package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
- package/dist/commonjs/components/ConsoleLogCard.js +262 -442
- package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
- package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
- package/dist/commonjs/components/CopyButton.d.ts +1 -1
- package/dist/commonjs/components/CopyButton.js +4 -4
- package/dist/commonjs/components/DiffViewer.js +4 -2
- package/dist/commonjs/components/DomainHeader.js +66 -41
- package/dist/commonjs/components/EmptyState.d.ts +2 -2
- package/dist/commonjs/components/EmptyState.js +2 -2
- package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
- package/dist/commonjs/components/EndOfListFooter.js +89 -0
- package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
- package/dist/commonjs/components/ErrorBoundary.js +28 -28
- package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
- package/dist/commonjs/components/FloatingBubble.js +75 -0
- package/dist/commonjs/components/HeadersSection.js +5 -3
- package/dist/commonjs/components/HighlightText.d.ts +1 -1
- package/dist/commonjs/components/HighlightText.js +5 -7
- package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +231 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
- package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
- package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
- package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
- package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
- package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkTab.js +282 -0
- package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
- package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
- package/dist/commonjs/components/Inspector/TabBar.js +95 -0
- package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
- package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
- package/dist/commonjs/components/InspectorHeader.js +329 -0
- package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
- package/dist/commonjs/components/InspectorTabBar.js +90 -0
- package/dist/commonjs/components/JsonViewer.d.ts +5 -2
- package/dist/commonjs/components/JsonViewer.js +111 -172
- package/dist/commonjs/components/LogCard.js +109 -86
- package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
- package/dist/commonjs/components/MetaAccordion.js +23 -21
- package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
- package/dist/commonjs/components/NavigationTracker.js +76 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
- package/dist/commonjs/components/NetworkIcons.js +54 -8
- package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
- package/dist/commonjs/components/ReduxTabView.js +56 -0
- package/dist/commonjs/components/ReduxTreeView.d.ts +2 -2
- package/dist/commonjs/components/ReduxTreeView.js +243 -203
- package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
- package/dist/commonjs/components/SegmentedTabs.js +52 -0
- package/dist/commonjs/components/SettingsView.d.ts +13 -0
- package/dist/commonjs/components/SettingsView.js +328 -0
- package/dist/commonjs/components/TouchableScale.d.ts +2 -2
- package/dist/commonjs/components/TouchableScale.js +2 -2
- package/dist/commonjs/components/TreeNode.js +2 -2
- package/dist/commonjs/constants/index.js +1 -12
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +137 -13
- package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
- package/dist/commonjs/customHooks/networkLogger.js +0 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
- package/dist/commonjs/enums/index.d.ts +39 -0
- package/dist/commonjs/enums/index.js +50 -0
- package/dist/commonjs/helpers/index.d.ts +27 -1
- package/dist/commonjs/helpers/index.js +187 -12
- package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
- package/dist/commonjs/i18n/en.json +144 -0
- package/dist/commonjs/i18n/index.d.ts +2 -0
- package/dist/commonjs/i18n/index.js +27 -0
- package/dist/commonjs/i18n/locales/en.json +314 -0
- package/dist/commonjs/index.d.ts +1 -2
- package/dist/commonjs/index.js +196 -4800
- package/dist/commonjs/styles/AppColors.d.ts +148 -0
- package/dist/commonjs/styles/AppColors.js +176 -0
- package/dist/commonjs/styles/common.d.ts +3 -0
- package/dist/commonjs/styles/common.js +201 -0
- package/dist/commonjs/styles/index.d.ts +167 -442
- package/dist/commonjs/styles/index.js +239 -471
- package/dist/commonjs/types/enums.d.ts +9 -0
- package/dist/commonjs/types/enums.js +4 -0
- package/dist/commonjs/types/index.d.ts +4 -111
- package/dist/commonjs/types/index.js +16 -0
- package/dist/commonjs/types/interfaces.d.ts +337 -0
- package/dist/commonjs/types/interfaces.js +2 -0
- package/dist/esm/assets/svgAssets.d.ts +3 -0
- package/dist/esm/assets/svgAssets.js +14 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/esm/components/AnalyticsEventCard.js +32 -49
- package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
- package/dist/esm/components/AnalyticsGraph.js +8 -8
- package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
- package/dist/esm/components/AnalyticsTabView.js +151 -0
- package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
- package/dist/esm/components/AnimatedEntrance.js +2 -2
- package/dist/esm/components/ApiDetailView.d.ts +22 -0
- package/dist/esm/components/ApiDetailView.js +264 -0
- package/dist/esm/components/ApisTabView.d.ts +33 -0
- package/dist/esm/components/ApisTabView.js +196 -0
- package/dist/esm/components/CodeSnippet.d.ts +1 -5
- package/dist/esm/components/CodeSnippet.js +34 -34
- package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
- package/dist/esm/components/ConsoleLogCard.js +262 -409
- package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/esm/components/ConsoleLogDetailView.js +271 -0
- package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/esm/components/ConsoleLogsTabView.js +348 -0
- package/dist/esm/components/CopyButton.d.ts +1 -1
- package/dist/esm/components/CopyButton.js +5 -5
- package/dist/esm/components/DiffViewer.js +4 -2
- package/dist/esm/components/DomainHeader.js +66 -41
- package/dist/esm/components/EmptyState.d.ts +2 -2
- package/dist/esm/components/EmptyState.js +2 -2
- package/dist/esm/components/EndOfListFooter.d.ts +8 -0
- package/dist/esm/components/EndOfListFooter.js +83 -0
- package/dist/esm/components/ErrorBoundary.d.ts +5 -14
- package/dist/esm/components/ErrorBoundary.js +29 -29
- package/dist/esm/components/FloatingBubble.d.ts +14 -0
- package/dist/esm/components/FloatingBubble.js +68 -0
- package/dist/esm/components/HeadersSection.js +5 -3
- package/dist/esm/components/HighlightText.d.ts +1 -1
- package/dist/esm/components/HighlightText.js +5 -7
- package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +193 -0
- package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
- package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/esm/components/Inspector/FabLauncher.js +49 -0
- package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
- package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/esm/components/Inspector/InspectorContext.js +13 -0
- package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
- package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/LogDetail.js +925 -0
- package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/esm/components/Inspector/MainScreen.js +63 -0
- package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
- package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
- package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkTab.js +244 -0
- package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxTab.js +70 -0
- package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
- package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
- package/dist/esm/components/Inspector/TabBar.js +90 -0
- package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/esm/components/Inspector/WebViewTab.js +752 -0
- package/dist/esm/components/InspectorHeader.d.ts +19 -0
- package/dist/esm/components/InspectorHeader.js +323 -0
- package/dist/esm/components/InspectorTabBar.d.ts +16 -0
- package/dist/esm/components/InspectorTabBar.js +84 -0
- package/dist/esm/components/JsonViewer.d.ts +5 -2
- package/dist/esm/components/JsonViewer.js +112 -173
- package/dist/esm/components/LogCard.js +111 -88
- package/dist/esm/components/MetaAccordion.d.ts +1 -10
- package/dist/esm/components/MetaAccordion.js +23 -21
- package/dist/esm/components/NavigationTracker.d.ts +7 -0
- package/dist/esm/components/NavigationTracker.js +39 -0
- package/dist/esm/components/NetworkIcons.d.ts +6 -0
- package/dist/esm/components/NetworkIcons.js +46 -6
- package/dist/esm/components/ReduxTabView.d.ts +9 -0
- package/dist/esm/components/ReduxTabView.js +50 -0
- package/dist/esm/components/ReduxTreeView.d.ts +2 -2
- package/dist/esm/components/ReduxTreeView.js +245 -204
- package/dist/esm/components/SegmentedTabs.d.ts +15 -0
- package/dist/esm/components/SegmentedTabs.js +47 -0
- package/dist/esm/components/SettingsView.d.ts +13 -0
- package/dist/esm/components/SettingsView.js +321 -0
- package/dist/esm/components/TouchableScale.d.ts +2 -2
- package/dist/esm/components/TouchableScale.js +2 -2
- package/dist/esm/components/TreeNode.js +2 -2
- package/dist/esm/constants/index.js +1 -12
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +137 -13
- package/dist/esm/customHooks/networkLogger.d.ts +0 -1
- package/dist/esm/customHooks/networkLogger.js +0 -1
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
- package/dist/esm/enums/index.d.ts +39 -0
- package/dist/esm/enums/index.js +47 -0
- package/dist/esm/helpers/index.d.ts +27 -1
- package/dist/esm/helpers/index.js +180 -11
- package/dist/esm/helpers/settingsStore.d.ts +2 -24
- package/dist/esm/i18n/en.json +144 -0
- package/dist/esm/i18n/index.d.ts +2 -0
- package/dist/esm/i18n/index.js +22 -0
- package/dist/esm/i18n/locales/en.json +314 -0
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +200 -4796
- package/dist/esm/styles/AppColors.d.ts +148 -0
- package/dist/esm/styles/AppColors.js +176 -0
- package/dist/esm/styles/common.d.ts +3 -0
- package/dist/esm/styles/common.js +197 -0
- package/dist/esm/styles/index.d.ts +167 -442
- package/dist/esm/styles/index.js +239 -471
- package/dist/esm/types/enums.d.ts +9 -0
- package/dist/esm/types/enums.js +3 -0
- package/dist/esm/types/index.d.ts +4 -111
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/types/interfaces.d.ts +337 -0
- package/dist/esm/types/interfaces.js +1 -0
- package/example/App.tsx +145 -2
- package/example/README.md +33 -77
- 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
|
|
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
|
|
28
|
-
|
|
|
29
|
-
| Network
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
| Analytics
|
|
33
|
-
| Redux
|
|
34
|
-
|
|
|
35
|
-
| Error
|
|
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
|
-
|
|
55
|
+
### Peer & Native Dependencies
|
|
56
56
|
|
|
57
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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,
|
|
89
|
+
When mounted, the inspector automatically sets up network logging, intercepts console methods, and attaches Firebase Analytics if available.
|
|
93
90
|
|
|
94
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
```tsx
|
|
107
|
-
<NetworkInspector enabled={false} />
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Settings Persistence
|
|
105
|
+
### Toggling Visibility
|
|
113
106
|
|
|
114
|
-
|
|
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
|
-
|
|
110
|
+
// Fully disable the overlay and interception
|
|
111
|
+
<NetworkInspector enabled={__DEV__} />
|
|
120
112
|
|
|
121
|
-
|
|
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
|
-
##
|
|
119
|
+
## 🪵 Console Logger & Stack Trace
|
|
129
120
|
|
|
130
|
-
|
|
121
|
+
The console logger provides deep insight into every `console.log`, `info`, `warn`, and `error` call:
|
|
131
122
|
|
|
132
|
-
|
|
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
|
-
|
|
136
|
-
|
|
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()`
|
|
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
|
|
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
|
-
##
|
|
165
|
+
## 🔄 Redux State & Action Inspection
|
|
183
166
|
|
|
184
|
-
|
|
167
|
+
Connect your Redux store once during application startup:
|
|
185
168
|
|
|
186
169
|
```tsx
|
|
187
|
-
import {
|
|
170
|
+
import {connectReduxStore} from 'react-native-inapp-inspector';
|
|
171
|
+
import store from './store';
|
|
188
172
|
|
|
189
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
225
|
+
## 🧭 Navigation & Screen Tracking
|
|
224
226
|
|
|
225
|
-
|
|
227
|
+
To group network requests, logs, and analytics by the active screen, pass your navigation container ref:
|
|
226
228
|
|
|
227
229
|
```tsx
|
|
228
|
-
import {
|
|
229
|
-
import
|
|
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
|
-
|
|
237
|
-
import {inspectorReduxMiddleware} from 'react-native-inapp-inspector';
|
|
233
|
+
const navigationRef = createNavigationContainerRef();
|
|
238
234
|
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
##
|
|
249
|
+
## ⚙️ Settings Persistence
|
|
253
250
|
|
|
254
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
<
|
|
279
|
-
</ErrorBoundary
|
|
271
|
+
<YourApp />
|
|
272
|
+
</ErrorBoundary>
|
|
280
273
|
```
|
|
281
274
|
|
|
282
275
|
---
|
|
283
276
|
|
|
284
|
-
## Public API
|
|
285
|
-
|
|
286
|
-
| Export
|
|
287
|
-
|
|
|
288
|
-
| `NetworkInspector`
|
|
289
|
-
| `setupNetworkLogger()`
|
|
290
|
-
| `addAxiosInterceptors(instance)`
|
|
291
|
-
| `clearNetworkLogs()`
|
|
292
|
-
| `subscribeNetworkLogs(
|
|
293
|
-
| `setupConsoleLogger()`
|
|
294
|
-
| `clearConsoleLogs()`
|
|
295
|
-
| `subscribeConsoleLogs(
|
|
296
|
-
| `
|
|
297
|
-
| `
|
|
298
|
-
| `
|
|
299
|
-
| `
|
|
300
|
-
| `
|
|
301
|
-
| `
|
|
302
|
-
| `
|
|
303
|
-
| `
|
|
304
|
-
| `
|
|
305
|
-
| `
|
|
306
|
-
| `
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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 {
|
|
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;
|