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

@mo3ta-dev/rn-analytics-debugger

v1.0.3

Published

Mobile-first analytics debugger for React Native with optional Desktop integration

Readme

@mo3ta-dev/rn-analytics-debugger (Mobile SDK)

The internal logic and UI for the React Native Analytics Debugger.

🏗 Architecture Overview

The SDK is built on a Proxy/Adapter pattern to intercept analytics events without requiring changes to existing business logic.

High-Level Data Flow

graph TD
    subgraph "Client App"
        Code[Existing Business Logic]
    end

    subgraph "Mobile SDK"
        Proxy["wrapTealium() / Proxy"]
        Debugger[AnalyticsDebugger Singleton]
        Store[EventStore - Ring Buffer]
        UI[AnalyticsDebuggerDialog / React UI]
        WS[WebSocket Client]
    end

    subgraph "External"
        Tealium[Real Tealium SDK]
        Desktop[Desktop Viewer App]
    end

    Code -->|track call| Proxy
    Proxy -->|Log Event| Debugger
    Proxy -->|Forward| Tealium
    Debugger -->|Push| Store
    Debugger -->|Broadcast| WS
    Store -->|Sync State| UI
    WS -.->|WebSocket| Desktop

📦 Key Components

1. AnalyticsDebugger (Singleton)

The "Brain" of the SDK. It manages:

  • Global configuration (enabled, desktopSync, etc.)
  • The lifecycle of the EventStore.
  • WebSocket connection to the Desktop App.
  • Event broadcasting to subscribers (like the UI).

2. EventStore

A lightweight in-memory ring buffer that stores up to 1000 events (configurable). It prevents memory leaks by automatically discarding the oldest events when the capacity is reached.

3. Default Tracker (Built-in)

You can log events directly via AnalyticsDebugger.getInstance() without any adapter:

const debugger = AnalyticsDebugger.getInstance();
debugger.trackEvent('purchase', { amount: 99.99 });
debugger.trackView('HomeScreen');
debugger.trackError('network_timeout', { url: '/api/data' });

This works alongside any adapter (e.g., wrapTealium). Both the default tracker and the adapters feed into the same event store and UI.

4. TealiumAdapter & wrapTealium

  • wrapTealium(instance): Uses a transparent proxy pattern (monkey-patching) to intercept .track() calls. This is the recommended way to integrate as it requires zero changes to your tracking calls.
  • TealiumAdapter: A class-based alternative that implements the AnalyticsProvider interface.

4. Mobile UI Components

  • AnalyticsDebuggerDialog: A floating component that renders on top of the app. It listens to the AnalyticsDebugger for status changes.
  • AnalyticsDebuggerView: The primary dashboard containing the event list and filters.
  • JSONViewer: A recursive component for deep inspection of event payloads.

🛠 Tech Stack

  • React Native: Core UI components.
  • TypeScript: Full type safety for events and configuration.
  • WebSockets: Real-time event streaming to the desktop app.
  • Jest: Unit tested core logic.

🔄 Lifecycle

  1. Init: The debugger is initialized with a config.
  2. Intercept: Calls to tealium.track() are intercepted by the proxy.
  3. Storage: The event is added to the EventStore.
  4. Broadcast:
    • The Mobile UI re-renders with the new event.
    • If enabled, the event is sent via WebSocket to the Desktop App.
  5. Clear: Manually clearing logs resets the EventStore and updates all connected listeners.