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

@mobore/rum-react-native

v0.1.54

Published

React Native SDK for RUM Mobile Observability

Downloads

111

Readme

@mobore/rum-react-native

React Native SDK for RUM Mobile Observability.

Installation

This package requires the following native dependencies:

  • @react-native-community/netinfo
  • react-native-device-info

You can install them along with the package:

For vanilla React Native (using npm):

npm install @mobore/rum-react-native @react-native-community/netinfo react-native-device-info

For Expo projects:

expo install @mobore/rum-react-native @react-native-community/netinfo react-native-device-info

Expo Compatibility

This package relies on native code, which means it's not compatible with Expo Go. You'll need to use a custom development client. After installing the dependencies, you may need to generate the native project files before running:

npx expo prebuild

Then run your app on a simulator or device:

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

Usage

Initialization

Initialize the RUM SDK as early as possible in your application's lifecycle. The easiest way is to use the RumProvider component which wraps your application.

Using RumProvider (Recommended)

The RumProvider enables automatic instrumentation of views, errors, and network requests. For automatic view tracking to work, you need to provide a ref to your NavigationContainer.

Example with React Navigation:

// App.tsx
import { RumProvider } from '@mobore/rum-react-native';
import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native';

export default function App() {
  const navigationRef = useNavigationContainerRef();

  return (
    // The RumProvider needs the navigation ref to track screen views.
    <RumProvider
      config={{
        clientToken: "YOUR_CLIENT_TOKEN",
      }}
      ref={navigationRef}
    >
      <NavigationContainer ref={navigationRef}>
        {/* Your application's navigators and screens */}
      </NavigationContainer>
    </RumProvider>
  );
}

Example with Expo Router:

If you're using Expo Router, you can wrap your root layout. Expo Router's layout components automatically handle the ref.

// app/_layout.tsx
import { RumProvider } from '@mobore/rum-react-native';
import { useNavigationContainerRef } from 'expo-router';

export default function RootLayout() {
  const navigationRef = useNavigationContainerRef();

  return (
    <RumProvider
      config={{
        clientToken: "YOUR_CLIENT_TOKEN",
      }}
      ref={navigationRef}
    >
      {/* Your application's components */}
    </RumProvider>
  );
}

This will auto enable tracing views, errors, network request.

Alternatively, for manual initialization without the RumProvider component:

import RUM, { AutoInstrumentation } from '@mobore/rum-react-native';

RUM.initialize({
  clientToken: 'YOUR_CLIENT_TOKEN',
}).then(() => {
  // Start auto-instrumentation for navigation and errors
  AutoInstrumentation.start();
});

Manual View Tracking

Track screen views manually, useful for single-page applications or when automatic tracking is insufficient.

import RUM from '@mobore/rum-react-native';

// Start a view
RUM.startView('HomeScreen');

Track Actions

Record user interactions or custom actions within your application. This is useful for tracking things like button clicks, form submissions, or other important events.

Example with a React Native Button:

import { Button } from 'react-native';
import RUM from '@mobore/rum-react-native';

function PurScreen() {
  const handlePurchase = () => {
    // ... purchase logic ...

    // Track the purchase action
    RUM.addAction('Purchase Completed', {
      actionType: 'click',
      attributes: {
        productId: 'abc-456',
        price: 19.99,
        currency: 'USD',
      },
    });
  };

  return (
    <Button title="Purchase" onPress={handlePurchase} />
  );
}

You can also add actions without a specific user interaction:

import RUM from '@mobore/rum-react-native';

RUM.addAction('Loaded User From Cache', { actionType: 'custom' });
// You can also pass a context to addAction
const currentContext = RUM.getCurrentContext();
RUM.addAction(currentContext, 'Item Added to Cart');

Track Errors

Manually report errors to RUM, alongside automatic crash reporting.

import RUM from '@mobore/rum-react-native';

try {
  // Some code that might throw an error
  throw new Error('Something went wrong!');
} catch (error) {
  RUM.addError(error, 'frontend_logic');
}

// You can also track string errors
RUM.addError('Failed to load data', 'network_request');

// You can also pass a context to addError
const currentContext = RUM.getCurrentContext();
RUM.addError(currentContext, 'Error with context', 'custom_context_error');