Rework PostHog setup — use Next.js ingest proxy + posthog-js/react

Mirrors the proven pattern from gendersloty: rewrites /ingest/* to
the PostHog host so requests go through the same origin (no CORS,
no ad-blocker issues). Uses PostHogProvider and usePostHog from
posthog-js/react official React integration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tim Leikauf
2026-07-01 21:50:43 +02:00
parent eb228ba50b
commit 4274d680e1
5 changed files with 53 additions and 13 deletions

View File

@@ -1,2 +1,3 @@
import posthog from 'posthog-js'
export { posthog }
export { usePostHog } from 'posthog-js/react'