Connect PostHog to your Goodspeed app
Product analytics, session recording, and feature flags, all GDPR-compliant and consent-gated from day one. Goodspeed wires PostHog into every app that needs it at generation time, so you start with a working integration, not a blank config and a documentation tab.
WHAT GETS WIRED IN
Built into every PostHog build
Every app Goodspeed generates with PostHog includes these wired integrations from the first build. No manual setup required.
| Item | Description | Strength |
|---|---|---|
| Lazy singleton initialization: the PostHog client is only created after analytics consent is granted, matching a GDPR opt-out posture | Lazy singleton initialization: the PostHog client is only created after analytics consent is granted, matching a GDPR opt-out posture | 01 |
| identifyPostHogUser() called on login and signup with optional traits including subscription tier | identifyPostHogUser() called on login and signup with optional traits including subscription tier | 02 |
| resetPostHogUser() called on logout to clear user identity from the session | resetPostHogUser() called on logout to clear user identity from the session | 03 |
| captureEvent() helper used throughout the template for auth, purchase, navigation, and error events | captureEvent() helper used throughout the template for auth, purchase, navigation, and error events | 04 |
| Session recording enabled via the $session_recording_enabled property when configured in gasConfig | Session recording enabled via the $session_recording_enabled property when configured in gasConfig | 05 |
| Feature flag checks via posthog.isFeatureEnabled in hooks/useFeatureFlag.ts for A/B testing UI variants | Feature flag checks via posthog.isFeatureEnabled in hooks/useFeatureFlag.ts for A/B testing UI variants | 06 |
Source: gas-template repository · analytics/feature-flags
REAL GENERATED CODE
A snippet from a PostHog integration the pipeline ships
This pattern comes directly from the gas-template codebase. The studio generates PostHog integration code like this for every app that includes it, not a placeholder you have to fill in yourself.
Consent-aware init
// lib/posthog.ts let _posthog: PostHog | null = null; export async function getPostHog(): Promise<PostHog | null> { if (_posthog) return _posthog; const granted = await checkAnalyticsConsent(); if (!granted) return null; if (!apiKey) return null; _posthog = new PostHog(apiKey, { host, persistence: 'memory', bootstrap: { distinctId: await getAnonymousId() }, }); return _posthog; }
Today's log
APPS THAT USE POSTHOG
Where this integration ships
These app types include PostHog as part of the generated stack. Each link goes to a full spec page with capabilities, scored ideas, and a pipeline walkthrough.
- Build a Social App appBuilding a social app from scratch means solving hard infrastructure problems: real-time feeds, fan-out writes, notification delivery, and content moderation hooks. Goodspeed generates a complete sociSOCIAL APP
- Build a Fitness Tracker appBuilding a fitness tracker means wiring together daily logging, progress charts, Apple Health, and push reminders. Goodspeed generates all of that in a single build, not a patchwork of tutorials. The FITNESS TRACKER APP
- Build a Productivity App appProductivity apps succeed when they remove friction from the moment the user decides to work. Goodspeed generates a productivity app with Pomodoro timer, focused task queue, distraction blocker hooks,PRODUCTIVITY APP