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

@realtime-inspector/client-health-react-native

v0.7.0

Published

Device & app performance telemetry as Replay Model primitives, so "what was happening on the user's device" lands on the same replay timeline as provider events. See `docs/06-providers/client-health-plugin.md`.

Readme

@realtime-inspector/client-health-react-native

Device & app performance telemetry as Replay Model primitives, so "what was happening on the user's device" lands on the same replay timeline as provider events. See docs/06-providers/client-health-plugin.md.

This package is app-agnostic — it knows nothing about any consuming app. The native layer is reached through one swappable seam (NativeHealthCollector), so the plugin runs JS-only (Phase A) or with the bundled Nitro module (Phase B).

Usage

JS-only (no native code, ships immediately):

import { createInspector } from '@realtime-inspector/core'
import { createClientHealthPlugin, createClientHealthSampler } from '@realtime-inspector/client-health-react-native'

const inspector = createInspector({
  endpoint: '…',
  sampler: createClientHealthSampler(),
})
inspector.use(createClientHealthPlugin()) // JS FPS + JS stall + incidents

There is no fidelity-mode switch. Collection cadence follows the inspector's collectionIntervalMs, and how much survives is decided by the core metric-norm gate plus server-pushed sampling rates (delivered via onAck) — not a client setMode. See docs/09-operations/production-modes.md.

With the native collector (full CPU/RAM/thermal/battery/UI FPS):

import { createNativeHealthCollector } from '@reincraft/plugin-client-health-react-native/native'

inspector.use(createClientHealthPlugin({ collectors: [createNativeHealthCollector()] }))

The ./native entry imports react-native-nitro-modules; keep it out of any non-RN bundle. If the native module isn't present, omit collectors and the plugin degrades to JS-only.

What it emits

  • Metrics (metricSample, sampleable): client_health.memory.*, client_health.cpu.*, client_health.fps.{ui,js}, client_health.frames.dropped (raw cumulative), client_health.thread.{js,main}_stall_ms, client_health.battery.level, client_health.thermal.state, plus the observer-effect self-metric client_health.sdk.collect_ms.
  • Incidents (event, lossless): client_health.memory.warning, client_health.thermal.critical, client_health.battery.saver_changed. These are genuine OS/library PUSH facts. The metric-DERIVED incidents (fps.drop, thread.{js,main}_stall) were removed — an out-of-norm gauge is the signal now and the backend infers the episode (docs/99-wip/metric-norm-gate.md).

Perspective-scoped: the device IS the perspective — no entityRef in V1.

Native module (Phase B) — build follow-up

The from-scratch Nitro module lives in ios/, android/, and the spec in src/specs/client-health.nitro.ts. It is not built or verified in this repo (no app context).

Native autolinking is DISABLED by default (react-native.config.js sets both platforms to null). Without it, a consumer that linked this package would try to compile ios/HybridClientHealth.swift, which references the not-yet-generated HybridClientHealthSpec and fail the build. So the JS-only path works in any app out of the box; the native module is explicit opt-in.

To wire the native module in a consumer:

  1. bun nitrogen — codegens HybridClientHealthSpec + struct classes from the spec.
  2. Remove react-native.config.js (or re-enable the platforms).
  3. iOS: pod install (picks up ReincraftClientHealth.podspec).
  4. Android: autolinking via android/build.gradle.

Aggregation (UI FPS, dropped frames, main-thread stall) runs natively; only one struct per tick crosses the bridge. Native sources reference proven platform APIs (task_vm_info, host_cpu_load_info, ProcessInfo.thermalState, CADisplayLink on iOS; ActivityManager PSS, /proc/stat, PowerManager, Choreographer on Android) but the module is independent of any app.