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

@userboost/react-native

v1.1.10

Published

UserBoost React Native SDK for mobile analytics

Readme

@userboost/react-native

UserBoost React Native SDK for mobile analytics and user tracking.

Installation

npm install @userboost/react-native

Required Peer Dependencies

npm install @react-native-async-storage/async-storage

Optional Dependencies (for enhanced device context)

npm install react-native-device-info

Usage

Basic Setup

import UserBoost from '@userboost/react-native';

// Initialize in your App.js or index.js
UserBoost.init({
  apiKey: 'ub_your_api_key_here',
  debug: __DEV__ // Enable debug logging in development
});

Track Events

UserBoost.event('button_clicked', {
  user: { id: 'user123' },
  properties: {
    button_name: 'signup',
    screen: 'home'
  }
});

Identify Users

UserBoost.identify({
  id: 'user123',
  email: '[email protected]',
  traits: {
    name: 'John Doe',
    plan: 'premium'
  }
});

Features

Automatic Device Context

The SDK automatically collects:

  • Device model and brand
  • OS version (iOS/Android)
  • App version and build number
  • Screen resolution
  • Device locale and timezone
  • RTL layout detection

Persistent User Data

User data is automatically persisted to AsyncStorage and restored on app restart.

App Lifecycle Handling

Events are automatically flushed when the app goes to background.

Network Resilience

  • Automatic retry with exponential backoff
  • Offline queue management
  • Smart error handling

API Reference

Core Methods

  • init(config) - Initialize the SDK
  • event(name, data) - Track an event
  • identify(userData) - Identify a user
  • flush() - Manually flush queued events
  • reset() - Reset user data and queue
  • debug(enabled) - Enable/disable debug logging

React Native Specific

  • getDeviceContext() - Get current device context
  • checkStorageAvailability() - Check if AsyncStorage is working

Configuration Options

interface UserBoostConfig {
  apiKey: string;          // Required: Your UserBoost API key
  endpoint?: string;       // Optional: Custom API endpoint
  debug?: boolean;         // Optional: Enable debug logging
  user?: UserData;         // Optional: Initial user data
  batchSize?: number;      // Optional: Events per batch (default: 10)
  flushInterval?: number;  // Optional: Auto-flush interval (default: 2000ms)
  maxRetries?: number;     // Optional: Max retry attempts (default: 3)
}

Troubleshooting

AsyncStorage Issues

If you see storage warnings, ensure AsyncStorage is properly installed:

npx react-native unlink @react-native-async-storage/async-storage
npx react-native link @react-native-async-storage/async-storage

For React Native 0.60+, use autolinking:

cd ios && pod install

DeviceInfo Issues

DeviceInfo is optional. If you don't need enhanced device context, you can skip this dependency.

TypeScript Support

Full TypeScript support is included. All types are re-exported from @userboost/core.

Platform Support

  • React Native 0.60+
  • iOS 9.0+
  • Android API level 16+