Compare commits

...

4 Commits

Author SHA1 Message Date
Trevor Hudson 44a4c2f04f changeset 2025-05-14 21:32:40 -07:00
Trevor Hudson ff2442038f feat: add exception tracking to PostHog 2025-05-14 21:30:43 -07:00
Trevor Hudson 732c604b90 make sure machine ID is there 2025-05-13 09:45:25 -07:00
Trevor Hudson a936fa3cc3 add boostrap 2025-05-12 23:03:22 -07:00
3 changed files with 20 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
add distinct id bootstrap
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
add exception tracking
+10 -2
View File
@@ -5,10 +5,14 @@ import { posthogConfig } from "@shared/services/config/posthog-config"
import { useExtensionState } from "./context/ExtensionStateContext"
export function CustomPostHogProvider({ children }: { children: ReactNode }) {
const { telemetrySetting } = useExtensionState()
const { telemetrySetting, vscMachineId } = useExtensionState()
const isTelemetryEnabled = telemetrySetting !== "disabled"
useEffect(() => {
if (vscMachineId.length === 0) {
return
}
posthog.init(posthogConfig.apiKey, {
api_host: posthogConfig.host,
ui_host: posthogConfig.uiHost,
@@ -16,6 +20,10 @@ export function CustomPostHogProvider({ children }: { children: ReactNode }) {
disable_session_recording: true,
capture_pageview: false,
capture_dead_clicks: true,
capture_exceptions: true,
bootstrap: {
distinctID: vscMachineId,
},
})
if (isTelemetryEnabled) {
@@ -23,7 +31,7 @@ export function CustomPostHogProvider({ children }: { children: ReactNode }) {
} else {
posthog.opt_out_capturing()
}
}, [isTelemetryEnabled])
}, [isTelemetryEnabled, vscMachineId])
return <PostHogProvider client={posthog}>{children}</PostHogProvider>
}