Overview
Once the widget is loaded withgr("loadReferralWidget", ...)
and a valid auth_token
(JWT) is provided, the referral interface is accessible via window.referralWidget
. You can invoke this at any time to display the referral modal.
There are two ways to display the modal:
- Programmatically via JavaScript – Manually trigger the modal from a button or custom UI event.
- Automatically via URL Parameters – Open the modal based on a query string like
?reditus-show-referral=program
.
Displaying the Modal Programmatically
Javascript
Implementation Example
Displaying the Modal via URL Parameters
The widget also supports deep linking using a query parameter like:?reditus-show-referral=program
When the URL contains this parameter, the referral widget will automatically open and optionally switch to a specific tab:
Value | Behavior |
---|---|
program | Opens the Referral Program tab |
referrals | Opens the Referrals tab |
rewards | Opens the Rewards tab |
Example URLs
https://your-app.com/dashboard?reditus-show-referral=program
https://your-app.com/account/settings?reditus-show-referral=referrals
https://your-app.com/billing?reditus-show-referral=rewards
ℹ️ The modal will open automatically after the widget is loaded and the user is authenticated.