Quickstarts
Quickstarts
Add Refport referral tracking to your app in minutes — pick your framework.
Refport tracks a three-event funnel for every referred visitor:
| Event | When | Who calls it |
|---|---|---|
| Click | Visitor lands on your site via a referral link | Browser SDK (automatic) |
| Lead | Visitor creates an account | Your server |
| Sale | Lead makes a purchase | Your server or Stripe webhook |
SDK overview
| Package | Where it runs | Purpose |
|---|---|---|
refport-js | Browser | Reads refp_id from URL, stores in cookie |
@refport/react | Browser (React) | <RefportTracker /> component wrapping refport-js |
refport | Server (Node.js) | track.lead(), track.sale(), cookie helpers |
@refport/better-auth | Server | Automatic lead tracking via Better Auth plugin |
If you use Better Auth, lead tracking is automatic — the @refport/better-auth plugin intercepts every sign-up and calls track.lead() for you with no extra code.