GenerateSaaS

Affiliate tracking

Credit referral partners for signups and purchases with the anonymous, browser-side Refgrow, Affonso, and PromoteKit pixels under config.affiliate.

Affiliate tracking wires referral pixels so partners get credited for signups and purchases, configured under config.affiliate in @repo/config. Tracking is anonymous and browser-side - no database table, no webhook. config.affiliate is absent from the default config, so the feature ships off; the presence of a provider sub-key turns it on.

Providers

Three providers, each behind its own sub-key carrying a publicKey from that vendor's dashboard. Each publicKey is required - omit it and that provider stays off.

Sub-keyProviderKeysLoads
refgrowRefgrowpublicKeyscripts.refgrowcdn.com/latest.js
affonsoAffonsopublicKey, cookieDuration? (days, default 30)affonso.io/js/pixel.min.js
promotekitPromoteKitpublicKeycdn.promotekit.com/promotekit.js
// packages/config/src/index.ts
affiliate: {
  enableInDev: false,        // default - trackers stay off locally
  refgrow: { publicKey: "..." },
  affonso: { publicKey: "...", cookieDuration: 60 },
  promotekit: { publicKey: "..." },
},

Add each vendor's domain to any Content-Security-Policy script-src allowlist you maintain.

Affiliate keys are public by design and ship to the browser. Never paste a secret API key into config.

Behavior

AspectBehavior
TrackingAnonymous and browser-side - no identify hook, no DB row, no webhook. Conversions are reported to each vendor's own dashboard, not to your app.
enableInDevOptional, default false - scripts stay off locally, keeping your dashboards clean. Set true to test.
CookiesAll three providers drop cookies.
ConsentPixels surface the banner but never wait on it - they load after the page is interactive regardless of the visitor's choice.

Under cookieBanner: "auto", an enabled provider surfaces the banner only when its script would actually load - so enableInDev: false keeps it hidden in local development. See Cookie consent.

On this page