GenerateSaaS

Integrations

Wire third-party analytics, support chat, and affiliate trackers in @repo/config behind a GDPR-aware cookie banner.

Third-party services are configured in @repo/config (packages/config/src/index.ts) and rendered client-side (analytics additionally feeds a small server seam for webhook-driven events). Each provider turns on by the presence of its config sub-key; only consent-required scripts wait for the banner.

Two distinct behaviors - do not conflate them. A provider can surface the banner (because it drops cookies) yet still load its script regardless of the visitor's choice. Only Google and PostHog actually wait for consent.

IntegrationConfig keyDrops cookiesSurfaces bannerWaits for consent
Google Analyticsconfig.analytics.googleYesYesYes
PostHogconfig.analytics.posthogYesYesYes
Privacy-focused analyticsconfig.analytics.{umami,plausible,openpanel,datafast,ahrefs,vercel}NoNoNo
Crisp chatconfig.support.crispYesYesNo - loads anyway
Chatwoot chatconfig.support.chatwootYesYesNo - loads anyway
Affiliate trackersconfig.affiliate.{refgrow,affonso,promotekit}YesYesNo - pixels load anyway
  • Under the default cookieBanner: "auto", the banner appears only when a surfacing provider is enabled and the visitor must consent (isGdprCountry from @repo/utils/helpers, which fails safe to true when geo is unknown).
  • Out of the box no surfacing provider is enabled, so the banner stays hidden until you turn one on.
  • Declining persists as a tri-state acceptedCookies cookie: "false" keeps Google and PostHog off, while support chat and affiliate pixels still load.

Local development

Each group has its own enableInDev flag - config.analytics.enableInDev, config.support.enableInDev, config.affiliate.enableInDev - all defaulting to false, so nothing loads locally. The flag also gates the "auto" banner: a provider counts toward the trigger only when its script would actually load.

All analytics and affiliate keys are public (publishable) and ship to the browser. Never paste a secret API key into config.

On this page