npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-debug-logger

v2.0.3

Published

A powerful network debugger and logger for React Native that works even in production builds.

Readme

🚀 react-native-debug-logger

Production-Ready Network Monitor & Debug Tool for React Native

npm version license platform

A powerful network debugger and logger for React Native that works even in production builds.

Capture network requests, console logs, and dynamically switch API environments — all inside your app with a modern hidden UI.


👀 Preview


✨ Features

🌐 Network Monitoring

  • Intercepts fetch and XMLHttpRequest
  • Optional Axios support
  • Full request/response inspection
  • Duration, headers, payload tracking

🔄 Dynamic Environment Switching

  • Change API Base URL at runtime
  • Supports Production / Staging / Test / Custom
  • No rebuild required
  • Smart redirection engine

🕵️ Hidden Debug Access

  • Multi-tap trigger system
  • Works anywhere in the app
  • Invisible for end-users

🔐 Security Layer

  • Password-protected access
  • Role-based enable/disable logic
  • Safe for production usage

🎨 Premium UI

  • Glassmorphism design
  • Dark mode optimized
  • Smooth animations
  • Floating debug button

🔍 Filtering & Search

  • Filter by:
    • Request
    • Response
    • Error
  • Search by URL or content

📤 Export & cURL

  • Copy requests as executable cURL
  • Export logs via share sheet

🌍 Localization

  • Auto-detect device language
  • Supports: AZ, EN, TR, RU

⚡ Quick Start (1-Minute Setup)

Wrap your app. That’s it.

import { DebugTrigger } from 'react-native-debug-logger';

const App = () => {
  return (
    <DebugTrigger 
      password="2025"
      clicksNeeded={5}
      prodUrl="https://api.myapp.com"
      testUrl="https://test-api.myapp.com"
    >
      <YourAppRoot />
    </DebugTrigger>
  );
};

✔ No config ✔ Works instantly ✔ Works in Release builds


🧠 Deep Dive: Architecture

This library is built around 3 core pillars:

1. Logger (Core Engine)

  • Singleton pattern
  • Centralized log storage
  • Handles all incoming events

2. Monitors (Interceptors)

  • Patches:
    • fetch
    • XMLHttpRequest
    • console
  • Captures and forwards all activity to Logger

3. UI Layer

  • DebugTrigger → hidden entry point
  • DebugMonitor → full dashboard

🌐 Network Layer Explained

  • Uses global patching
  • Does NOT block original requests
  • Clones request/response safely

Captured data:

  • URL
  • Method
  • Headers
  • Body
  • Status
  • Duration

🔁 Smart Redirection Engine

Example:

https://api.prod.com/users
➡️ https://api.test.com/users

✔ Happens before request is sent ✔ Transparent to your app

🧠 Smart Exclusions

Internal dev traffic like localhost:8081 is automatically ignored to prevent conflicts.


🕵️ DebugTrigger System

  • Detects multiple taps (clicksNeeded)
  • Opens password modal
  • Activates debug session

After activation:

  • Floating DEBUG button appears
  • Quick re-access enabled

🖥 Debug Monitor Dashboard

Tabs

  • All → everything
  • Network → API logs
  • Logs → console output
  • Settings → environment control

Extra Capabilities

  • URL redirection indicator
  • Real-time updates
  • Clean cURL generation

⚙️ State & Performance

  • No Redux / MobX / external state libs
  • Uses Subscriber Pattern
  • Lightweight and fast

Memory Control

  • Max ~500 logs (configurable)
  • Auto cleanup of old logs

🛠 Advanced Usage

Custom Base URLs

<DebugTrigger
  password="admin"
  clicksNeeded={7}
  baseUrls={[
    { title: 'Local', url: 'http://192.168.1.10:3000' },
    { title: 'Staging', url: 'https://staging.myapp.com' }
  ]}
  onBaseUrlChange={(url) => {
    console.log('New Base URL:', url);
  }}
>
  <App />
</DebugTrigger>

Manual Logging API

import { Logger } from 'react-native-debug-logger';

Logger.logInfo('User action', { id: 1 });
Logger.logError('Something failed');
Logger.logNavigation('HomeScreen');
Logger.logDatabase('SELECT * FROM users');

🆚 Why react-native-debug-logger?

| Feature | This Library | Others | | ------------------- | ------------ | ------ | | Works in Production | ✅ | ❌ | | Built-in UI | ✅ | ❌ | | Zero dependencies | ✅ | ❌ | | API switching | ✅ | ❌ | | Hidden access | ✅ | ❌ |


👥 Who is this for?

  • React Native developers debugging APIs
  • Teams working with multiple environments
  • QA engineers testing builds
  • Production debugging scenarios

🛡 Security Best Practice

Disable for normal users:

const isEnabled = __DEV__ || isAdmin;

return isEnabled ? (
  <DebugTrigger>{children}</DebugTrigger>
) : children;

📦 Installation

npm install react-native-debug-logger

📚 Keywords

react-native, debug, logger, network, axios, fetch, interceptor, monitoring, devtools


❤️ Support

If you find this useful, you can support my work:

👉 https://kofe.al/@alicanov98


👨💻 Author

Alijanov https://github.com/alicanov98


⭐ Star the Repo

If you like this project, give it a ⭐ — it really helps!


📄 License

MIT License