From 462835309c5b51493770fe8034f0ff1566a9eded Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 14 Jul 2026 14:03:23 -0400 Subject: [PATCH] fix(content): version-gate the Next.js client init rule instrumentation-client.ts is ignored on Next.js below 15.3, so client-side PostHog silently never initializes there. The nextjs commandment now states which init location to use for which version. Generated-By: PostHog Code Task-Id: f3b2162f-9a47-4d22-a83e-0a66900ed730 --- context/commandments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context/commandments.yaml b/context/commandments.yaml index 971780d5..18b0ada4 100644 --- a/context/commandments.yaml +++ b/context/commandments.yaml @@ -24,7 +24,7 @@ commandments: nextjs: # Initialization - - For Next.js 15.3+, initialize PostHog in instrumentation-client.ts for the simplest setup + - 'Initialize client-side PostHog in exactly one place, based on the "next" version in package.json: on 15.3 and later, use instrumentation-client.ts; below 15.3, use a "use client" PostHogProvider in the root layout (or _app), because instrumentation-client.ts is ignored there' nextjs-feature-flags: # Client-side feature flags