@live-inspect/react-native-inspect
v0.0.2
Published
A lightweight in‑app debug overlay for React Native signed APK/IPA builds. It captures network requests, errors, and app logs, and exposes them through an on‑device inspector UI.
Readme
React Native Inspect — In‑App Debug Overlay for React Native (APK/IPA)
A lightweight in‑app debug overlay for React Native signed APK/IPA builds. It captures network requests, errors, and app logs, and exposes them through an on‑device inspector UI.
Installation (npm / Yarn) — @live-inspect/react-native-inspect
npm install @live-inspect/react-native-inspect
# or
yarn add @live-inspect/react-native-inspectUsage
import { InspectProvider, useInspect } from "@live-inspect/react-native-inspect";
export default function App() {
return (
<InspectProvider enabled={!__DEV__} bubbleVisible={true /* optional */}>
<YourApp />
</InspectProvider>
);
}const { log, reportError, toggleBubble } = useInspect();
log("Checkout started", { cartId: "123" });
reportError(new Error("Payment failed"), { screen: "Checkout" });
// Optional: let users show/hide the bubble.
toggleBubble();InspectProvider options
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| enabled | boolean | false | Enables the inspector (UI + interceptors). |
| bubbleVisible | boolean | true | Shows/hides the floating bubble (panel is also forced closed when hidden). |
| config | Partial<InspectConfig> | — | Advanced config (buffers, panel position, etc.). |
useInspect() values & functions
| Name | Type | Description |
| --- | --- | --- |
| bubbleVisible | boolean | Current bubble visibility state. |
| log | (message, data?, level?) => void | Adds a log entry (level: info/warn/error). |
| reportError | (error, context?) => void | Adds an error entry. |
| showBubble | () => void | Shows the bubble. |
| hideBubble | () => void | Hides the bubble (and closes the panel). |
| toggleBubble | () => void | Toggles bubble visibility (closing panel when turning off). |
Notes
- If
enabledisfalse, the inspector UI and interceptors are not installed. - Bubble visibility defaults to
trueand can be set viaInspectProviderbubbleVisible. - Storage tab is optional and only shows data if AsyncStorage is available.
- Large payloads are truncated in the UI to avoid perf issues.
Example (Expo)
See example/ for a minimal Expo app wired to this library.
