I am following this PostHog tutorial and it involves wrapping my whole app in the PostHogProvider
, which has a use client
directive. Will this effectively turn my whole app into a client side app and opt me out of Next.js server components?
// app/providers.js
'use client'
import posthog from 'posthog-js'
import { PostHogProvider } from 'posthog-js/react'
export default function PHProvider({ children, bootstrapData }) {
if (typeof window !== 'undefined') {
posthog.init("<ph_project_api_key>", {
api_host: "https://us.i.posthog.com",
bootstrap: bootstrapData
})
}
return <PostHogProvider client={posthog}>{children}</PostHogProvider>
}