Skip to content

Commit 6de5e77

Browse files
authored
Merge pull request #44 from PostHog/admonish-against-providers
Admonish against using PostHogProvider components in Next 15.3+
2 parents 13f3b98 + 4f95b8f commit 6de5e77

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

basics/next-app-router/instrumentation-client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
1515
opt_out_useragent_filter: true, // This disables bot detection
1616
// @ignoreBlockEnd
1717
});
18+
19+
//IMPORTANT: Never combine this approach with other client-side PostHog initialization approaches, especially components like a PostHogProvider. instrumentation-client.ts is the correct solution for initializating client-side PostHog in Next.js 15.3+ apps.

basics/next-pages-router/instrumentation-client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
1515
opt_out_useragent_filter: true, // This disables bot detection
1616
// @ignoreBlockEnd
1717
});
18+
19+
//IMPORTANT: Never combine this approach with other client-side PostHog initialization approaches, especially components like a PostHogProvider. instrumentation-client.ts is the correct solution for initializating client-side PostHog in Next.js 15.3+ apps.

0 commit comments

Comments
 (0)