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

tester-analytics-sdk

v1.0.0

Published

Anonymous tester telemetry SDK for Expo and React Native apps, with offline queueing and self-hosted TesterFlow dashboards.

Readme

tester-analytics-sdk

Reusable anonymous tester analytics SDK for Expo / React Native Android apps.

Android App ──> tester-analytics-sdk ──> your dashboard (/api/events)

The SDK reports directly to your own dashboard over HTTPS. No Firebase, no Google Analytics, no PostHog/Mixpanel/Amplitude — no third-party analytics of any kind except your own server (see hesab-ketab-dashboard/CONNECTING_APPS.md).

The SDK provides:

  • Persistent anonymous Tester ID (UUID v4, stored in secure storage, survives app updates).
  • Offline event queue (SQLite / in-memory fallback) with retry + backoff.
  • Automatic tester/event registration after you create the app.
  • Screen, session, and foreground/background tracking.
  • Active-usage signals — session_start / session_resume / session_pause and a ~60s session_heartbeat while foreground, so the server can measure per-tester per-day active minutes.
  • Crash / JS-error reporting.
  • Expo Go compatible — no dev-client required.

The SDK core has zero dependencies — native modules are injected via thin adapters (tester-analytics-sdk/expo).


Quickstart (Expo Go)

Works immediately on Android Expo Go with no dev-client build.

1. Install

cd your-app
npm i file:../tester-analytics-sdk
npx expo install expo-secure-store expo-constants

This package is private and is installed from a local folder, so add a metro.config.js:

const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');

const config = getDefaultConfig(__dirname);
const sdkDir = path.resolve(__dirname, '..', 'tester-analytics-sdk');
config.watchFolders = [...(config.watchFolders ?? []), sdkDir];
config.resolver.nodeModulesPaths = [
  path.resolve(__dirname, 'node_modules'),
  path.resolve(sdkDir, 'node_modules'),
];
module.exports = config;

2. Add config to app.json

{
  "expo": {
    "extra": {
      "testerAnalytics": {
        "appId": "my-cool-app",
        "apiUrl": "https://saraayab.shop",
        "apiKey": "hk_your_key_here"
      }
    }
  }
}

3. Initialize (one line)

import { initializeExpoTesterAnalytics } from 'tester-analytics-sdk/expo';

export const tester = initializeExpoTesterAnalytics();

appId, apiUrl, and apiKey are read from app.json automatically. Create the app in the Developer portal first so it has an appId and API key. If apiUrl is empty/unset the SDK stays dormant and sends nothing anywhere.

4. Wire it in

import './src/tester';         // entry file — boots ID + session
// inside NavigationContainer
onReady={() => tester.setScreen(route.name)}
onStateChange={() => {
  const r = navigationRef.current?.getCurrentRoute();
  if (r?.name) tester.setScreen(r.name);
}}

5. Run

npx expo start          # opens in Expo Go

Manual init (no manifest auto-config)

If you prefer explicit options or don't use expo-constants, use the core initializeTesterAnalytics directly:

import * as SecureStore from 'expo-secure-store';
import { AppState } from 'react-native';
import { initializeTesterAnalytics } from 'tester-analytics-sdk';
import { secureStoreStorage } from 'tester-analytics-sdk/expo';

export const tester = initializeTesterAnalytics({
  appId: 'my-app',
  dashboard: {
    endpoint: 'https://saraayab.shop',
    apiKey: 'hk_your_key_here',
    appVersion: '1.0.0',
  },
  storage: secureStoreStorage(SecureStore),
  appState: AppState,
});

AppBackend API

| Method | Description | | --- | --- | | getTesterId() | Persistent anonymous UUID. | | setScreen(name, screenClass?) | Queue a screen_view. | | trackEvent(name, params?) | Queue a custom event (reaches /api/events as params). | | setContactName(name) / getContactName() | Opt-in contact name (shown to you in the dashboard only). | | setContactChannel(type, value) / getContactChannel() | Opt-in contact channel (telegram/whatsapp/email). | | setOptedOut(true) / getOptedOut() | Stop sending telemetry. When opted out the SDK sends nothing. | | markForeground(version?) | App active state: resume/boot a session. | | markBackground() | Pause the session (background/close). | | reportBug(message, options?) | Queue a bug_report event with steps/screen/screenshot/params. | | reportCrash(message, stack?) | Queue a crash event. | | flush() | Force-flush the local event queue now. | | eraseMyData() | Clear the local Tester ID + queue, then call the dashboard /api/tester/erase for the old ID. |

Adapter factories (tester-analytics-sdk/expo)

  • secureStoreStorage(expoSecureStore) — StorageAdapter.
  • expoDefaults() — creates storage + AppState from Expo modules.
  • readTesterAnalyticsConfig() — reads app.json extra.testerAnalytics.
  • initializeExpoTesterAnalytics(options?) — recommended one-liner.

Session / active-usage model

  • Boot sends session_start (or session_resume if a session was left open by a previous force-close/crash — stored under SESSION_ACTIVE_KEY).
  • Every ~60s while foreground the SDK sends session_heartbeat.
  • Backgrounding or app-close sends session_pause.
  • The server measures active time from its own clock between those signals, excludes background time, splits per-day totals, and auto-closes stale sessions (force-close/no network). See the dashboard README for full details.

Privacy / GDPR

  • Tester ID is a random UUID v4 — no PII.
  • Contact name/channel are opt-in only.
  • Opt-out stops all telemetry; eraseMyData() deletes local data and the tester's dashboard record (activity + usage).

Reinstall limitation

The Tester ID lives in secure storage. Uninstalling/reinstalling (or clearing app data) generates a brand-new ID, so analyses keyed on the user ID cannot follow a device across reinstalls. This is an intentional privacy trade-off (no account, no server-side identity).