Skip to main content
The referral widget is a small script that enrolls a signed-in user as a referrer and shows them their referral link and share UI — the drop-in way to run product-led referrals without building your own UI.

Embed it

Add the script inside your authenticated app, with a publishable key:

Attributes

data-key
string
required
A publishable key (pk_…) from Settings → Developers. Safe to expose in the browser.
data-user-id
string
required
Your stable user id — becomes the referrer’s external_user_id.
data-user-email
string
required
The user’s email.
data-user-tier
string
required
free or paid — determines the reward amount the user earns for referrals.
The widget calls /api/v1/referrals/enroll on load, so each signed-in user is enrolled and given their link automatically.

Completing the loop

The widget handles enrollment and sharing. To reward the referrer, report the referred signup from your backend when a new user registers — see /api/v1/referrals/report-signup. Pair this with credit fulfilment to deliver the reward automatically.
Prefer full control over the UI? Skip the widget and call the referral endpoints directly — the widget is just a convenient front end for the same API.