Getting Started
React Native API Integration
Overview
The ReferralHero API is organized around REST. Our API has predictable, resource-oriented URLs. JSON is returned by all API responses, including errors.
1. Get Your ReferralHero Keys & Token
API Token: Retrieve your
API_TOKENfrom the ReferralHero Dashboard by navigating to -> API: ReferralHero Dashboard.

Branch Key & Domains:
If you already have a Branch account, keep your credentials ready.
If not — no worries, we’ll handle the setup for you.
Once you configure your referral tracking campaign and enable Mobile Apps, we’ll email you the required credentials for integration:
branch_keybranch_universal_link_domains
If you don’t receive the email, please contact ReferralHero Support at support@referralhero.com
2. Install Dependencies
Using NPM
Using yarn
3. Configure App
📱 iOS Configuration
Associated Domains
To configure:
Open your project in Xcode.
Navigate to Target → Signing & Capabilities.
Add a new Associated Domains entry.
For each domain, add an entry in the following format:
If you've received your
branch_universal_link_domainsfrom us (as noted in Step 1), add each domain listed using theapplinks:prefix. ✅ Example: Ifbranch_universal_link_domains=Then in Associated Domains, you would add:

Info.plist Configuration Referralhero requires specific key/value pairs to be added to your project's
Info.plistfile:
branch_universal_link_domains: Specifies the associated domains your app will support for universal links.branch_key: Your Branch keyCFBundleURLTypes: Defines your app’s URL schemes and identifiers, allowing ReferralHero to correctly handle app openings via universal links.
Add the following to your Info.plist:
AppDelegate.swift Setup add the following to your app's AppDelegate file:
🤖 Android Configuration
AndroidManifest.xml Add the following inside the
<application>tag:MainActivity.kt
MainApplication.kt
4. Track Link Parameters in App
Add the following in your app’s entry point (e.g., App.js):
You can now use the visitor_id and referral_code from the link when calling ReferralHero APIs during user registration and start tracking referrals!
For that, you will need 2 things:
Universal Link
Your Integrated App
The RH SDK Pulls information from your Device, like this:
Last updated