mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-12 22:42:13 +02:00
feat: added posthog
This commit is contained in:
parent
d9e6947fbd
commit
518958e9a7
15 changed files with 526 additions and 17 deletions
13
surfsense_web/instrumentation-client.ts
Normal file
13
surfsense_web/instrumentation-client.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import posthog from "posthog-js";
|
||||
|
||||
if (process.env.NEXT_PUBLIC_POSTHOG_KEY) {
|
||||
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
|
||||
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
||||
defaults: "2025-11-30",
|
||||
// Disable automatic pageview capture, as we capture manually with PostHogProvider
|
||||
// This ensures proper pageview tracking with Next.js client-side navigation
|
||||
capture_pageview: "history_change",
|
||||
// Enable session recording
|
||||
capture_pageleave: true,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue