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

unitrack-react-native

v1.2.0

Published

UniTrack — universal mobile analytics SDK for React Native. Auto-captures screens, taps, network, crashes, OOM, JSON parse errors with persistent offline queue, session journey, and W3C trace propagation.

Readme

unitrack-react-native

Universal mobile analytics SDK for React Native. Auto-captures screens, taps, network calls, crashes, OOM warnings, and JSON parse errors with a persistent offline queue, session journey tracking, and W3C trace propagation.

  • 📦 Tiny integration — one initialize() call, the rest is automatic.
  • 🛰 Offline-first — events queue to SQLite + retry with exponential backoff; nothing is dropped when the network is down.
  • 🔁 Session journey — persistent session_id + session_index across cold starts; rotate manually on logout / context switch.
  • 🧭 W3C trace context — opt-in traceparent injection on outbound HTTP for backend correlation.
  • 🪝 Provider fan-out — every event forwarded to optional providers (@unitrack/snowplow, built-in Firebase Analytics adapter, custom).
  • 📱 Per-platform — Swift on iOS, Kotlin on Android, C++ core inside both.

Install

npm install unitrack-react-native
# iOS
cd ios && pod install

Initialize

import { UniTrack } from 'unitrack-react-native';

await UniTrack.initialize('utk_your_api_key', {
  endpoint: 'https://your-portal.com/event-tracking/v1/events',
  batchSize: 20,
  flushIntervalMs: 5000,
});

Track custom events

UniTrack.track('checkout_completed', {
  order_id: '1234',
  amount: 99.95,
  currency: 'USD',
});

Identify a user

UniTrack.identify('user_42', { plan: 'premium', email: '[email protected]' });

Session helpers

The native core owns session_id rotation + persists session_index across launches, so apps don't keep their own counter:

const id   = await UniTrack.currentSessionId();
const idx  = await UniTrack.sessionIndex();          // 1, 2, 3, …
const prev = await UniTrack.previousSessionId();     // for chaining

// Force a rotation on logout / switch-account:
await UniTrack.rotateSession();

Offline-queue debugging

const pending = await UniTrack.pendingEventCounts();
// { ev_screen_view: 7, ev_click: 3, ev_session: 1 }

// Auto-fire when a batch lands server-side:
const sub = UniTrack.onFlushCompleted((counts) => {
  console.log('Flushed', counts);
});
// later: sub.remove();

Remote config

Resolve runtime flags / strings without a rebuild. Order:

  1. Portal sdk_config.custom_values[key] (operator-edited)
  2. Firebase Remote Config (if host app links Firebase + calls UniTrack.attachFirebaseAdapter())
  3. Caller's defaultValue
const on  = await UniTrack.getRemoteValue('feature_camera_grid', false);
const ttl = await UniTrack.getRemoteValue('retry_delay_ms', 1500);

W3C tracing

UniTrack.setTracing({
  enabled: true,
  allowlistHosts: ['api.your-app.com', '*.your-app.com'],
});

React Navigation auto-capture

import { UniTrackRouteObserver } from 'unitrack-react-native';

<NavigationContainer onStateChange={UniTrackRouteObserver.onStateChange}>
  ...
</NavigationContainer>

Provider fan-out

Snowplow is a separate npm package. Firebase Analytics mirror is built-in via reflection — host app links Firebase itself, SDK has zero Firebase dependency.

import { UniTrack } from 'unitrack-react-native';
import { SnowplowProvider } from '@unitrack/snowplow';

UniTrack.addProvider(new SnowplowProvider({
  endpoint: 'https://collector.your-app.com',
  appId: 'mobile-app',
}));
// Host app: install @react-native-firebase/analytics + google-services config
await UniTrack.attachFirebaseAdapter();
await UniTrack.initialize(apiKey);

License

MIT — see LICENSE.