Files
supabase/packages/common/package.json
Sean Oliver e3e8528f72 feat: add client-side PostHog telemetry tracking (#37442)
Adds client-side PostHog tracking to run in parallel with server-side telemetry across studio, docs, and www. This enables session replays and resolves a race condition where page views arrive before group assignments resulting in attribution errors.

Changes:
- Created PostHog client wrapper with consent-aware initialization in common package
- Integrated PostHog client calls into existing telemetry functions to send events to both PostHog (client) and backend (server)
- Updated CSP to allow connections to PostHog endpoints
- Added environment variable support for all apps
- PostHog client accepts consent as a parameter and respects user preferences
- Events can be distinguished in PostHog by $lib property (posthog-js vs posthog-node)
- PostHog URL configured based on environment (staging/local uses ph.supabase.green)
- Maintains full backward compatibility with existing telemetry system

Resolves GROWTH-438
Resolves GROWTH-271
2025-08-06 09:15:51 -07:00

41 lines
1.0 KiB
JSON

{
"name": "common",
"version": "0.0.0",
"main": "./index.tsx",
"types": "./index.tsx",
"license": "MIT",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules",
"gen:types": "supabase gen types typescript --local >| ./database-types.ts",
"typecheck_CURRENTLY_IGNORED": "tsc --noEmit"
},
"dependencies": {
"@types/dat.gui": "^0.7.12",
"@usercentrics/cmp-browser-sdk": "^4.42.0",
"api-types": "workspace:*",
"config": "workspace:*",
"dat.gui": "^0.7.9",
"flags": "^4.0.0",
"lodash": "^4.17.21",
"next-themes": "^0.3.0",
"posthog-js": "^1.257.2",
"react-use": "^17.4.0",
"valtio": "catalog:"
},
"devDependencies": {
"@types/lodash": "4.17.5",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"tsconfig": "workspace:*",
"typescript": "~5.5.0"
},
"peerDependencies": {
"@supabase/auth-js": "catalog:",
"@supabase/supabase-js": "catalog:",
"next": "catalog:",
"react": "catalog:",
"react-dom": "catalog:"
}
}