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-release-health

v0.1.0

Published

Vendor-neutral OTA rollout health for React Native: session tagging, failed-update detection, and rollback recommendations.

Readme

react-native-release-health

CI npm

Vendor-neutral OTA rollout safety for React Native. Tag every session with the active update and native version, put fresh updates on probation, detect failed or crash-looping rollouts on the device, recommend (or trigger) rollback, and export the whole story to any sink. Works with your OTA vendor, not against it.

A deliberately crashing update goes on probation, crashes, and on the relaunch release-health declares it failed and recommends a rollback. Real recording, reproducible from the demo runbook.

Why

OTA delivery pipelines are excellent; the feedback loop about whether a rollout actually works on devices is missing. A broken update applies, crashes on launch, and crashes again on relaunch, while the dashboard only shows downloads going up. release-health closes the loop on the device: fresh updates must prove themselves interactive within a probation window, consecutive failed launches trip a crash-loop verdict, and the verdict arrives as a typed event you can alert on or automate.

Install

npm install react-native-release-health

You will also want an adapter for your OTA vendor and at least one sink:

Requires react-native 0.76 or newer with the New Architecture (the native module is a TurboModule; the legacy bridge is not supported). Expo apps work without a config plugin.

Usage

import { useEffect } from 'react';
import { ReleaseHealth, useReleaseHealth } from 'react-native-release-health';
import { expoUpdatesAdapter } from '@release-health/adapter-expo-updates';
import { httpSink } from '@release-health/sink-http';

ReleaseHealth.init({
  adapter: expoUpdatesAdapter(),
  sinks: [httpSink({ url: 'https://telemetry.example.com/release-health' })],
});

function App() {
  const { status, activeUpdateId } = useReleaseHealth();

  useEffect(() => {
    // Call when your first screen is actually usable, not merely rendered.
    ReleaseHealth.markHealthy();
  }, []);

  useEffect(
    () =>
      ReleaseHealth.onRollbackRecommended(({ updateId, reason }) => {
        // reason: 'crash-loop' | 'apply-failed'
      }),
    []
  );

  return <YourApp />;
}

API

ReleaseHealth.init(options)

Starts the engine. Call once, as early as possible.

| Option | Default | Description | | --- | --- | --- | | adapter | required | Your OTA vendor integration (OtaAdapter) | | sinks | [] | Where events go; the state machine runs regardless | | healthyTimeoutMs | 15000 | Deadline for markHealthy() after a fresh update launches | | crashLoopThreshold | 2 | Consecutive failed launches before the update is declared failed. The default fires on the second launch, after one crashed launch | | autoRollback | false | Run adapter.rollback() automatically on a failed verdict, where the adapter supports it | | cohort | none | Rollout cohort label attached to session_start |

ReleaseHealth.markHealthy()

Closes the probation window for the active update. Call it when your first screen is genuinely interactive: data loaded, navigation responsive. Calling it from a splash screen defeats the purpose.

ReleaseHealth.onRollbackRecommended(cb)

Subscribes to failed-update verdicts. Fires with { updateId, reason: 'crash-loop' | 'apply-failed' }. Returns an unsubscribe function.

ReleaseHealth.notifyReload()

Tell the engine you are about to intentionally reload (for example applying a downloaded update with Updates.reloadAsync()). A reload during probation restarts the probation timer instead of counting as a failed launch.

useReleaseHealth()

React hook returning { status, activeUpdateId, nativeVersion, buildNumber, cohort } and re-rendering on transitions.

Statuses: starting, stable (embedded or accepted bundle), probation (fresh update waiting for markHealthy()), healthy, suspect (timeout elapsed, not yet failed), failed (crash loop or apply failure; rollback recommended).

The event stream

Sinks receive typed ReleaseHealthEvents, each with sessionId and timestamp: session_start, update_downloaded, update_apply_success, update_apply_failed, crash, healthy, rollback_recommended, rollback_executed. See the repo README for the field-by-field table.

Writing an adapter

interface OtaAdapter {
  getActiveUpdateId(): Promise<string | null>; // null = embedded bundle
  getEmbeddedVersion(): Promise<string>;
  onEvent(cb: (e: OtaAdapterEvent) => void): Unsubscribe;
  rollback?(): Promise<boolean>; // optional; omit if the vendor has no client rollback
}

Without rollback(), the engine runs in recommendation-only mode; autoRollback logs a warning instead of failing. Adapters must never throw into the host app.

Writing a sink

interface Sink {
  onEvent(event: ReleaseHealthEvent): void;
  flush?(): Promise<void>;
  attach?(context: SinkContext): void; // observe live status, e.g. to tag a crash reporter
}

Sink exceptions are swallowed and logged by the engine; a misbehaving sink cannot take the app down.

How failure detection works

The native module (TurboModule, Swift/Objective-C and Kotlin, persisting to UserDefaults and SharedPreferences) records a clean-exit flag on graceful background or terminate. A launch that follows neither is treated as an abnormal exit. Fatal JS errors are additionally caught in-session via the global error handler. The engine counts consecutive failed probation launches and judges at launch start, so the verdict lands even when the crash killed the process before anything could be sent. __DEV__ short-circuits probation, so dev reloads never count.

This is a heuristic, and the library is honest about it: it detects "the app did not exit cleanly", not "the app crashed with this stack trace". Force-quits and OS kills read as abnormal exits too. Pair it with a crash reporter for ground truth (the Sentry sink exists exactly for that), and read docs/limitations.md before relying on it.

Zero-dependency bias

The core package has no runtime dependencies beyond react and react-native as peers. Persistence uses UserDefaults and SharedPreferences directly. Adapters and sinks reach their vendor SDKs as duck-typed peers and degrade to safe no-ops with one actionable warning when the peer is missing.

License

MIT