Prerequisites
React Native
Your application should use React Native version 0.73 or above. Applications using Expo should use version 50 or above. The New Architecture is fully supported.Android
React Native - your application should use React Native version 0.73 or above. Applications using Expo should use version 50 or above. The New Architecture is fully supported starting with version 4.4.0. Android - your application’sbuild.gradle must have a compileSdk of 35+ and minSdk of 21+, and use Android Gradle Plugin (AGP) 8.6+ (8.8.2+ recommended).
iOS
Your application must target iOS 13+ to install and render Userpilot content. Update the iOS project xcodeproj to set the deployment target, if needed. In the application’sPodfile , include at least this minimum version.
Installation
Add the Userpilot React Native Module dependency to your application.- In your app’s root directory, install the Userpilot React Native Module. You can fetch the latest version from here.
- Under your application’s
iosfolder, run
Initialization
To use Userpilot, initialize it once in your Application class. This ensures the SDK is ready as soon as your app starts. Update your Application class. Replace<APP_TOKEN> with your Application Token, which can be fetched from your Environments Page.
Using the SDK
Once initialized, the SDK provides straightforward APIs for identifying users, tracking events, and screen views.Identifying Users
This API is used to identify unique users and companies (groups of users) and set their properties. Once identified, all subsequent tracked events and screens will be attributed to that user. Recommended Usage:- On user authentication (login): Immediately call
identifywhen a user signs in to establish their identity for all future events. - On app launch for authenticated users: If the user has a valid authenticated session, call
identifyat app launch. - Upon property updates: Whenever user or company properties change.
- Key
idis required in company properties, to identify a unique company. - Userpilot supports String, Numeric, and Date types.
- Make sure you’re sending date values in ISO8601 format.
- If you are planning to use Userpilot’s localization features, make sure you are passing user property
locale_codewith a value that adheres to ISO 639-1 format. - Userpilot’s reserved properties’ have pre-determined types and improve profiles interface in the dashboard:
- Use key
emailto pass the user’s email. - Use key
nameto pass the user’s or company’s name. - Use key
created_atto pass the user’s or company’s signed up date.
- Use key
Tracking Screens (Required)
Calling screen is crucial for unlocking Userpilot’s core engagement and analytics capabilities. When a user navigates to a particular screen, invoking screen records that view and triggers any eligible in-app experiences. Subsequent events are also attributed to the most recently tracked screen, providing context for richer analytical insights. For these reasons, we strongly recommend tracking all of your app’s screen views.Tracking Events
Log any meaningful action the user performs. Events can be button clicks, form submissions, or any custom activity you want to analyze. Optionally, you can pass metadata with the event to provide specific context.Logging Out
When a user logs out, calllogout() to clear the current user context. This ensures subsequent events are no longer associated with the previous user.
Anonymous Users
If a user is not authenticated, callanonymous() to track events without a user ID. This is useful for pre-signup flows or guest user sessions.
Experience
Triggers a specific experience programmatically using it’s ID. This API allows you to manually initiate an experience within your application.Configurations (Optional)
| Parameter | Type | Description |
|---|---|---|
| logging | Boolean | Enable or Disable logs for SDK Default: false |
| disableRequestPushNotificationsPermission | Boolean | Disable request push notifications permission by SDK. Default: false |
| useInAppBrowser | Boolean | configuration to indicate when to open the URL inside CustomTabsIntent or not. Default: false |