Monitor React Native
The FastPix Video Data SDK for React Native lets you track and analyze video playback in real time within your mobile application. It automatically captures key performance metrics, helping you improve playback, reduce errors, and create a better viewer experience. All the data is sent directly to the FastPix Dashboard, where you can monitor and analyze it in depth.
Key features:
- Gain insights into user interactions with your videos.
- Track real-time metrics like bitrate, buffering, startup time, render quality, and playback failures.
- Identify and resolve video delivery bottlenecks for smoother playback.
- Access detailed error logs to quickly pinpoint and fix playback issues.
- Customize tracking with relevant metadata to fit your business needs.
- Visualize and compare metrics to make informed, data-driven decisions.
Install and setup
Import the SDK
Pass video component
Basic integration
Advanced customization
Step 1
Install and setup
Step 2
Import the SDK
Step 3
Pass video component
Step 4
Basic integration
Step 5
Advanced customization
Prerequisites
Before integrating the FastPix React Native Video Data SDK, ensure that your project meets the following requirements:
-
React native compatibility
Your project must use React version 18.1.0 or 19.x, and React Native version 0.72.0 or higher. These versions are required to ensure proper SDK functionality. Using outdated versions may lead to compatibility issues or degraded performance. -
react-native-video Integration
You must have react-native-video installed and properly configured. Since the FastPix SDK builds on top of this library to track video playback analytics, it’s essential for the SDK to function correctly. -
Get you workspace key
To track and analyze video performance, initialize the FastPix Data SDK with your Workspace key. This key is essential for client-side monitoring and must be included in your Android application’s code wherever you want to track video performance.
Step 1: Install and setup
Start by installing the FastPix React Native Video Data SDK via your preferred package manager:
This will add the necessary dependencies to your project.
Step 2: Import the SDK
Once the SDK is installed, import it into your component file:
This makes the fastpixReactNativeVideo function available to wrap your video component for tracking.
Step 3: Pass video component
The SDK exposes a wrapper function fastpixReactNativeVideo that takes your existing react-native-video component and returns a new instrumented component.
This Higher-Order Component (HOC) automatically attaches tracking logic - no manual event tracking is needed during playback.
Replace your original <Video> component with the newly instrumented FastPixVideo component:
Step 4: Basic integration example
Now that you’ve wrapped your video component using fastpixReactNativeVideo, you can use it just like any other React Native component. Make sure to pass all the necessary metadata and props.
You will need to include the workspace_id, as it is a required field for integrating with FastPix. This unique identifier links your playback data to the correct workspace, ensuring your analytics are accurately captured and displayed in the FastPix system.
FastPix automatically tracks playback behavior - no manual tracking code is needed after integration.
PLEASE NOTE
Both Platform and Dimensions from react-native are required. FastPix uses them to accurately gather device-specific information and calculate playback dimension metrics.
FastPix will begin collecting and sending data as soon as playback starts - with no additional tracking code required during runtime.
For enhanced tracking, refer to the User-Passable Metadata documentation to explore all supported metadata fields. FastPix supports both named attributes like video_title and video_id, as well as custom fields (custom_1 to custom_10) that let you pass application-specific values. These flexible options allow you to align playback analytics with your unique business logic.
Step 5: Advanced customization
FastPix allows for advanced customization in how you track playback data and metadata. You can fine-tune tracking for viewer identity, device information, and bandwidth performance.
1. Viewer ID tracking
FastPix supports two methods of managing viewer identity:
Option A: Manual viewer ID
If your app already handles user sessions, pass a viewer ID directly:
To disable automatic tracking, set shouldTrackViewer={false}.
Example usage:
Option B: SDK-managed viewer ID (Auto-generation)
Let FastPix generate a unique viewer ID for you. This is useful if you don’t manage sessions yourself.
Step 1: Install persistent storage
FastPix requires AsyncStorage to store the auto-generated ID
Then enable automatic tracking by setting shouldTrackViewer={true}.
Example usage:
Step 2: Rebuild Your App
Android:
iOS:
2. Pass platform and dimensions for device analytics
To capture accurate device-specific metrics (e.g., screen size, OS, orientation), you must pass Platform and Dimensions from React Native:
Note: These props are mandatory. FastPix uses them to associate playback metrics with real device environments and calculate visual dimensions accurately.
Example usage:
3. Track bitrate changes
To track bitrate switching (for adaptive streams like HLS/DASH), enable bandwidth reporting using reportBandwidth={true}.
Example usage:
Release notes
For a complete release history, including new features, improvements, and bug fixes, see the FastPix React Native data SDK CHANGELOG on GitHub.