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

@kloudmate/rum-react-native

v0.4.0

Published

KloudMate RUM SDK for React Native -- a thin native-module bridge over the rum-mobile KMP core.

Readme

@kloudmate/rum-react-native

Real User Monitoring for React Native apps. Captures screens, taps, HTTP calls, crashes, JS errors, and app performance, and sends them to KloudMate.

Installation

npm install @kloudmate/rum-react-native
cd ios && pod install   # iOS only

The native module links automatically on both platforms. No manual steps.

Expo

This SDK includes native code, so it does not run in Expo Go. Use a development build.

Add the config plugin to your app config:

{
  "expo": {
    "plugins": ["@kloudmate/rum-react-native"]
  }
}

Then create the development build:

npx expo prebuild
npx expo run:android   # or: npx expo run:ios

The plugin registers the native module on Android; iOS needs no extra setup. Works with the New Architecture. Everything else on this page (setup, screens, errors, events) is the same as any React Native app.

Setup

Initialise the SDK once, as early as possible, in your app entry file:

import { init } from '@kloudmate/rum-react-native';

init({
  endpoint: 'https://otel.kloudmate.com:4318',
  rumAccessToken: 'pk_your_public_key',
  applicationName: 'my-app',
  deploymentEnvironment: 'production',
  sessionReplayEnabled: true,
});

Screens, taps, HTTP calls, app start, crashes, and JS errors are captured automatically after this call.

Configuration

| Option | Type | Description | |---|---|---| | endpoint | string | Your KloudMate collector endpoint. Required. | | rumAccessToken | string | Your public RUM key (pk_...). Required. | | applicationName | string | Name your app appears under. Required. | | appId | string | App / bundle id. Defaults to the package name or bundle id. | | deploymentEnvironment | string | e.g. production, staging. | | version | string | Your app version. | | sampleRate | number | Fraction of sessions to record, 0.01.0. Default 1.0. | | sessionReplayEnabled | boolean | Record session replay. Default false. | | replaySampleRate | number | Fraction of recorded sessions that also capture replay, 0.01.0. Default 1.0. | | captureJsErrors | boolean | Capture uncaught JS errors. Default true. |

TypeScript definitions for the full option list are bundled with the package.

Identify the user

Call after sign in so sessions and errors are attributed to a user:

import { setUser } from '@kloudmate/rum-react-native';

setUser('user-123', '[email protected]');

Screens

React Navigation moves between screens without the native layer noticing, so report the active screen yourself:

import { NavigationContainer } from '@react-navigation/native';
import { setCurrentScreen } from '@kloudmate/rum-react-native';

<NavigationContainer
  onStateChange={(state) => {
    const route = state?.routes?.[state.index];
    if (route) setCurrentScreen(route.name);
  }}
>
  {/* ... */}
</NavigationContainer>

Screens reported this way appear in the Pages and journeys views. Call setCurrentScreen as early as your navigation allows: activity recorded before the first call is not attributed to a screen.

Errors

Uncaught JS errors are captured automatically. To report a handled error:

import { reportError } from '@kloudmate/rum-react-native';

try {
  doWork();
} catch (e) {
  reportError(e);
}

Pass captureJsErrors: false to init if you want to install your own handler instead, then call installJsErrorHandler() when you are ready.

Custom events

import { addEvent } from '@kloudmate/rum-react-native';

addEvent('checkout_completed', { value: 49.99, currency: 'INR' });

Use a constant event name and put the changing parts in the attributes. An attribute named value is treated as a numeric measurement.

Logout

Call endSession() when a user logs out, so the next user does not inherit the previous session:

import { endSession } from '@kloudmate/rum-react-native';

async function logout() {
  endSession();
  await clearAuthState();
}

HTTP capture on Android (optional)

Network requests are captured automatically once you route React Native's HTTP client through the SDK. Add this to your MainApplication (Kotlin), after initialising the SDK, before the app makes its first request:

import com.facebook.react.modules.network.OkHttpClientFactory
import com.facebook.react.modules.network.OkHttpClientProvider
import okhttp3.OkHttpClient

OkHttpClientProvider.setOkHttpClientFactory(OkHttpClientFactory {
    OkHttpClient.Builder()
        .apply { KloudMateRum.okHttpInterceptor()?.let { addInterceptor(it) } }
        .build()
})

API reference

getSessionId and getGlobalAttributes return a Promise; the rest return immediately.

| Function | Description | |---|---| | init(options) | Initialise the SDK. Call once. | | setUser(id, email, extra) | Identify the current user. | | endSession() | Clear the user and start a new session. Call on logout. | | setGlobalAttributes(attrs) | Attach attributes to everything the SDK sends. | | getGlobalAttributes() | Read the current global attributes. | | getSessionId() | Current session id, or null. | | setCurrentScreen(name) | Report the active screen. | | reportFullyDrawn() | Mark the app fully drawn, recording time to first usable screen. | | addEvent(name, attributes) | Record a custom event. | | reportError(error, options) | Report a handled error. Pass { fatal: true } for a crash. | | installJsErrorHandler() | Install the uncaught-JS-error handler manually. |

Limitations

  • HTTP requests are not captured on iOS.
  • A hang on the JavaScript thread is not detected while the native thread stays responsive.

License

MIT