fix: switch to PostHogProvider per official React guide #112
Reference in New Issue
Block a user
Delete Branch "fix/posthog-react-provider"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Switches from manual
posthog.init()to the official@posthog/reactPostHogProvider wrapper per PostHog's React integration guide.Changes:
@posthog/reactPostHogProviderinmain.tsx(replaces manualinitAnalytics())VITE_PUBLIC_POSTHOG_KEYandVITE_PUBLIC_POSTHOG_HOSTenv varsdefaults: '2026-01-30'for recommended PostHog settingsposthog.__loadedfor readiness instead of a manual flagRailway env vars needed (frontend service):
VITE_PUBLIC_POSTHOG_KEY=phc_dS59G33cVarNsTKD2yP26MIRhkQtmYdVg9oSYDqTlRgVITE_PUBLIC_POSTHOG_HOST=https://us.i.posthog.comVITE_POSTHOG_KEYif set🤖 Generated with Claude Code