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. AirBridge App Credentials

    If you already have an AirBridge 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:

    • YOUR_APP_NAME

    • YOUR_APP_SDK_TOKEN

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

3.1 Android Configuration

a) Add Intent Filters in AndroidManifest.xml

Add under your <activity>:

Scheme Deep Link:

App Links:

b) Initialize SDK in MainApplication.kt

c) Track Deep Links in MainActivity.kt


3.2 iOS Configuration

a) Associated Domains

To configure:

  1. Open your project in Xcode.

  2. Navigate to Target → Signing & Capabilities.

  3. Add a new Associated Domains entry.

  4. Add an entry in the following format:

b) Initialize SDK in AppDelegate file

c) Handle Deep Links


Place this code in the root file of your project. Fetch the required parameters and store them for later use in the Signup API. The two key parameters are:

  • visitor_id: The unique ID of the referred visitor who clicked the referral link. This must be included in the Signup API to track and attribute the referral upon signup.

  • referrer: The identifier of the original referrer. This is optional, as visitor_id alone is sufficient for tracking the referral.

You can now use the visitor_id and referrer 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