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-key | Provider | Keys | Loads |
|---|---|---|---|
refgrow | Refgrow | publicKey | scripts.refgrowcdn.com/latest.js |
affonso | Affonso | publicKey, cookieDuration? (days, default 30) | affonso.io/js/pixel.min.js |
promotekit | PromoteKit | publicKey | cdn.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
| Aspect | Behavior |
|---|---|
| Tracking | Anonymous and browser-side - no identify hook, no DB row, no webhook. Conversions are reported to each vendor's own dashboard, not to your app. |
enableInDev | Optional, default false - scripts stay off locally, keeping your dashboards clean. Set true to test. |
| Cookies | All three providers drop cookies. |
| Consent | Pixels 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.
Support chat
Render a Crisp or Chatwoot live-chat widget from config.support, identified to the signed-in user, on both web and the desktop app.
External Agent (MCP)
Expose your app's AI capabilities to an external agent (the user's own Claude Code or Codex) over an OAuth-authenticated MCP server, with the same capability set the in-app assistant has.