feat: integrate PostHog for analytics tracking and add PostHogProvider component
This commit is contained in:
11
lib/posthog.ts
Normal file
11
lib/posthog.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { PostHog } from "posthog-node"
|
||||
|
||||
export default function PostHogClient() {
|
||||
const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
|
||||
host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
||||
capture_pageview: 'history_change',
|
||||
flushAt: 1,
|
||||
flushInterval: 0,
|
||||
})
|
||||
return posthogClient
|
||||
}
|
||||
Reference in New Issue
Block a user