Skip to main content

Overview

This document is for the mobile engineer integrating the B2Metric React Native SDK into an app, and it assumes you're already comfortable with React Native, JavaScript or TypeScript, and the usual iOS and Android build tooling. It doesn't assume any prior analytics background; anything specific to B2Metric is explained as it comes up.

The sections are ordered roughly the way you'll work through an integration: install the package, link the iOS pods, initialize the SDK, and send your first event. From there it covers the things you'll come back to as your integration grows, like identifying users, registering push tokens, and understanding what the SDK is doing automatically in the background so you don't have to.

If you hit a build error or your events aren't showing up where you expect, the Troubleshooting section near the end covers the situations that come up most often. The API reference is there when you just need to check a method signature.

The B2Metric React Native SDK lets your app capture product analytics events, manage sessions automatically, and report push notification activity, all with a single JavaScript / TypeScript API that works identically on iOS and Android.

Setup and releases: npmjs.com/package/@b2metric/react-native-sdk

Features​

  • Custom event tracking with properties and item-level data
  • User identification with custom attributes (setUser)
  • Automatic session management (first_open, session_start, session_end)
  • Push notification token registration (FCM, HMS, APNS) and open tracking
  • Offline event queuing with persistent storage
  • Automatic batching, retry with exponential backoff, and network-aware delivery
  • Automatic device and app metadata collection
  • Configurable log levels for debugging
  • TypeScript support

Requirements​

  • React Native >= 0.71
  • iOS 13+ / Android API 24+