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

@heronsignal/react-native

v0.1.1

Published

React Native wrapper for HeronSignal mobile analytics and diagnostics.

Readme

HeronSignal React Native

React Native SDK for sending mobile app screens, business events, logs, and errors to HeronSignal.

Use it when you want HeronSignal to understand what happens inside your mobile app, not only your website.

Install

npm install @heronsignal/react-native

or:

yarn add @heronsignal/react-native

Android setup

The React Native package uses the HeronSignal Android SDK under the hood. Add JitPack to your Android repositories.

In android/settings.gradle or android/settings.gradle.kts:

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    google()
    mavenCentral()
    maven("https://jitpack.io")
  }
}

Then rebuild the app:

npx react-native run-android

Expo note

This package uses a native module. It is intended for React Native bare apps or Expo development builds.

It will not work inside Expo Go until a config plugin is added.

Initialize once

Initialize HeronSignal when your app starts.

import { useEffect } from "react";
import { HeronSignal } from "@heronsignal/react-native";

export function App() {
  useEffect(() => {
    HeronSignal.init({
      publicKey: "pk_your_workspace_key",
      appVersion: "1.0.0",
      environment: "production",
    });
  }, []);

  return null;
}

Track screens

Screens are the mobile equivalent of pages.

import React, { useEffect } from "react";
import { HeronSignal } from "@heronsignal/react-native";

export function PricingScreen() {
  useEffect(() => {
    HeronSignal.screen("Pricing");
  }, []);

  return null;
}

With React Navigation:

import React, { useEffect } from "react";
import { NavigationContainer, useNavigationContainerRef } from "@react-navigation/native";
import { HeronSignal } from "@heronsignal/react-native";

export function App() {
  const navigationRef = useNavigationContainerRef();
  const routeNameRef = React.useRef<string | undefined>();

  useEffect(() => {
    HeronSignal.init({
      publicKey: "pk_your_workspace_key",
      appVersion: "1.0.0",
      environment: "production",
    });
  }, []);

  return (
    <NavigationContainer
      ref={navigationRef}
      onReady={() => {
        routeNameRef.current = navigationRef.getCurrentRoute()?.name;
        if (routeNameRef.current) {
          HeronSignal.screen(routeNameRef.current);
        }
      }}
      onStateChange={() => {
        const currentRouteName = navigationRef.getCurrentRoute()?.name;
        if (currentRouteName && routeNameRef.current !== currentRouteName) {
          HeronSignal.screen(currentRouteName);
          routeNameRef.current = currentRouteName;
        }
      }}
    >
      {/* Your navigators */}
    </NavigationContainer>
  );
}

Track business events

Use business events for meaningful user actions such as demo requests, signups, checkout steps, onboarding progress, or important CTA clicks.

import { Button } from "react-native";
import { HeronSignal } from "@heronsignal/react-native";

export function DemoButton() {
  return (
    <Button
      title="Request demo"
      onPress={() => {
        HeronSignal.event("demo_requested", {
          screen: "Pricing",
          cta: "request_demo",
          source: "hero",
        });
      }}
    />
  );
}

These events can later power funnels such as:

signup_started -> signup_completed
demo_requested -> demo_booked
checkout_started -> checkout_completed

Send app logs

Use logs for important app behavior you want to explain later in HeronSignal.

import { HeronSignal } from "@heronsignal/react-native";

HeronSignal.log("warn", "Checkout retry happened", {
  screen: "Checkout",
  area: "payment",
});

Recommended levels:

  • info
  • warn
  • error

Capture errors

import { HeronSignal } from "@heronsignal/react-native";

try {
  await submitLeadForm();
} catch (error) {
  HeronSignal.captureError(error, {
    screen: "Pricing",
    flow: "lead_form",
  });

  throw error;
}

Privacy guidance

Do not send sensitive user data in event payloads.

Avoid:

  • passwords
  • access tokens
  • payment card data
  • full names
  • emails
  • phone numbers
  • full message contents

Prefer safe labels:

HeronSignal.event("checkout_started", {
  plan: "growth",
  source: "pricing",
});

API

import { HeronSignal } from "@heronsignal/react-native";

await HeronSignal.init(options);
await HeronSignal.screen(name, data);
await HeronSignal.event(name, payload);
await HeronSignal.log(level, message, data);
await HeronSignal.captureError(error, data);

init(options)

type HeronSignalInitOptions = {
  publicKey: string;
  apiUrl?: string;
  appVersion?: string;
  environment?: string;
};

Payloads

Payloads should be small, non-sensitive JSON objects.

type HeronSignalPayload = Record<string, unknown>;

Dashboard behavior

Mobile SDK data appears in HeronSignal as mobile app telemetry:

  • screen(...) becomes screen/page activity.
  • event(...) becomes business events and can be used in funnels.
  • log(...) appears in Logger.
  • captureError(...) appears as app errors.

Current status

This is an alpha SDK. Android support is available first. iOS support is planned.