diff --git a/src/shared/services/config/posthog-config.ts b/src/shared/services/config/posthog-config.ts index fa68ad01..39a10146 100644 --- a/src/shared/services/config/posthog-config.ts +++ b/src/shared/services/config/posthog-config.ts @@ -1,6 +1,15 @@ // Public PostHog key (safe for open source) -export const posthogConfig = { +const posthogProdConfig = { apiKey: "phc_qfOAGxZw2TL5O8p9KYd9ak3bPBFzfjC8fy5L6jNWY7K", host: "https://data.cline.bot", uiHost: "https://us.posthog.com", } + +// Public PostHog key for Development Environment project +const posthogDevEnvConfig = { + apiKey: "phc_uY24EJXNBcc9kwO1K8TJUl5hPQntGM6LL1Mtrz0CBD4", + host: "https://data.cline.bot", + uiHost: "https://us.i.posthog.com", +} + +export const posthogConfig = process.env.IS_DEV === "true" ? posthogDevEnvConfig : posthogProdConfig diff --git a/webview-ui/src/CustomPostHogProvider.tsx b/webview-ui/src/CustomPostHogProvider.tsx index 12c10132..114b6f6d 100644 --- a/webview-ui/src/CustomPostHogProvider.tsx +++ b/webview-ui/src/CustomPostHogProvider.tsx @@ -8,7 +8,15 @@ export function CustomPostHogProvider({ children }: { children: ReactNode }) { const { telemetrySetting, distinctId, version } = useExtensionState() const isTelemetryEnabled = telemetrySetting !== "disabled" + // NOTE: This is a hack to stop recording webview click events temporarily. + // Remove this to re-enable. + const temporaryDisabled = true + useEffect(() => { + if (temporaryDisabled) { + return + } + posthog.init(posthogConfig.apiKey, { api_host: posthogConfig.host, ui_host: posthogConfig.uiHost, @@ -19,7 +27,7 @@ export function CustomPostHogProvider({ children }: { children: ReactNode }) { }, []) useEffect(() => { - if (distinctId.length === 0 || version.length === 0) { + if (temporaryDisabled || distinctId.length === 0 || version.length === 0) { return }