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

  1. API Token: Retrieve your API_TOKEN from the ReferralHero Dashboard by navigating to -> API: ReferralHero Dashboard.

  1. 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_key

    • branch_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

  1. Associated Domains

    To configure:

    1. Open your project in Xcode.

    2. Navigate to Target → Signing & Capabilities.

    3. Add a new Associated Domains entry.

    4. For each domain, add an entry in the following format:

      If you've received your branch_universal_link_domains from us (as noted in Step 1), add each domain listed using the applinks: prefix. ✅ Example: If branch_universal_link_domains =

      Then in Associated Domains, you would add:

  1. Info.plist Configuration Referralhero requires specific key/value pairs to be added to your project's Info.plist file:

  • branch_universal_link_domains: Specifies the associated domains your app will support for universal links.

  • branch_key: Your Branch key

  • CFBundleURLTypes: 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:

  1. AppDelegate.swift Setup add the following to your app's AppDelegate file:


🤖 Android Configuration

  1. AndroidManifest.xml Add the following inside the <application> tag:

  2. MainActivity.kt

  3. MainApplication.kt

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:

  1. Universal Link

  2. Your Integrated App

The RH SDK Pulls information from your Device, like this:

Last updated