fix: use explicit PostHog client init for reliable tracking #113

Merged
chihlasm merged 1 commits from fix/posthog-react-provider into main 2026-03-16 23:25:17 +00:00

1 Commits

Author SHA1 Message Date
chihlasm
ae6fed25e1 fix: use explicit posthog.init() with client prop for reliable initialization
Switch from apiKey+options pattern to explicit posthog.init() before
render, then pass client instance to PostHogProvider. This is more
reliable and matches the PostHog SDK docs' recommended client pattern.

Enables autocapture and pageview tracking per PostHog defaults.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 19:24:55 -04:00