Skip to main content
This document is part of a 3-part guide for integrating the Reditus Referral Program In-App Widget. In this first step, we’ll cover how to load the widget into your application. Loading the widget is essential because it brings in the necessary JavaScript and exposes the functions you’ll need to display referral information to your users.

Overview

The Reditus referral widget is loaded via the Pageview Tracking Script, that should already be installed in your app. You should add the following snippet where your frontend has access to user data and the JWT token from your backend. Once you invoke the gr("loadReferralWidget", ...) method, it automatically fetches the referral program code and makes the widget available through window.referralWidget.

Example Usage

Javascript

Parameters

Once called, the script fetches the referral widget and attaches it to window.referralWidget, allowing you to interact with it in your application.

Next steps

Check out Authenticating the User to learn how to generate the auth_token (JWT).