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:
Changelog
All notable changes to this project will be documented in this file.
[1.0.3]
⚠️ Important — FastPix is migrating from .io to .com
All FastPix-owned hosts and documentation links are being moved from the .io TLD to .com. The .io hosts continue to serve traffic during the transition, but they are slated to be suspended soon — please update any hard-coded references in your application as part of your next deploy.
What this means for users of @fastpix/react-native-video-data:
- This SDK doesn’t hard-code any FastPix host — playback telemetry is forwarded via
@fastpix/video-data-core, which has already been pointed at the.comingest endpoint. Bump to1.0.3(and re-runnpm install) to pick up the updated transitive dependency; no code change is required on your side. - If your app code references FastPix URLs directly — playback URLs (
stream.fastpix.io/...), image CDN (images.fastpix.io/...), dashboard deep links, or doc links in your own README — update them to the.comequivalents before the.iohosts are decommissioned. - We strongly recommend upgrading every FastPix SDK in your stack to its latest release as part of the same change; every official FastPix SDK is being rolled out with the same migration.
Changed
- README and developer guide updated end-to-end from
dashboard.fastpix.io/docs.fastpix.io/...todashboard.fastpix.com/fastpix.com/docs/...so every link in the package points at the post-migration host structure. - Reference links (Homepage, Dashboard, API Reference, “Detailed Usage”) repointed to
fastpix.com. - Sample playback URL in code examples updated from
stream.fastpix.iotostream.fastpix.com.
[1.0.2]
Changed
- Patch release:
package.jsonversion aligned to 1.0.2.
[1.0.1]
Changed
- Documentation: README updates.
[1.0.0]
Added
- Initial release of the FastPix React Native Video Data SDK for Android and iOS.
fastpixReactNativeVideoHOC to wrapreact-native-videoand forward playback telemetry via@fastpix/video-data-core.- Playback and quality-oriented events (e.g. play, pause, buffering, errors, time updates, variant / bandwidth where supported).
- Optional SDK-managed viewer and session identifiers using
@react-native-async-storage/async-storagewhenshouldTrackVieweris enabled. - Support for passing
PlatformandDimensionsfor device metadata and fullscreen-aware layout.