Skip to content

Commit 4628353

Browse files
committed
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
1 parent 3acc65d commit 4628353

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

context/commandments.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ commandments:
2424

2525
nextjs:
2626
# Initialization
27-
- For Next.js 15.3+, initialize PostHog in instrumentation-client.ts for the simplest setup
27+
- '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'
2828

2929
nextjs-feature-flags:
3030
# Client-side feature flags

0 commit comments

Comments
 (0)