Download src/services/analytics/config.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/services/analytics/config.ts
- Command line
-
hf download hf://chenbhao/codev@afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/services/analytics/config.ts
-
curl -L -o config.ts https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/services/analytics/config.ts
1.24 kB
| /** | |
| * Shared analytics configuration | |
| * | |
| * Common logic for determining when analytics should be disabled | |
| * across all analytics systems (Datadog, 1P) | |
| */ | |
| import { isEnvTruthy } from '../../utils/envUtils.js' | |
| import { isTelemetryDisabled } from '../../utils/privacyLevel.js' | |
| /** | |
| * Check if analytics operations should be disabled | |
| * | |
| * Analytics is disabled in the following cases: | |
| * - Test environment (NODE_ENV === 'test') | |
| * - Third-party cloud providers (Bedrock/Vertex) | |
| * - Privacy level is no-telemetry or essential-traffic | |
| */ | |
| export function isAnalyticsDisabled(): boolean { | |
| return ( | |
| process.env.NODE_ENV === 'test' || | |
| isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || | |
| isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || | |
| isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) || | |
| isTelemetryDisabled() | |
| ) | |
| } | |
| /** | |
| * Check if the feedback survey should be suppressed. | |
| * | |
| * Unlike isAnalyticsDisabled(), this does NOT block on 3P providers | |
| * (Bedrock/Vertex/Foundry). The survey is a local UI prompt with no | |
| * transcript data — enterprise customers capture responses via OTEL. | |
| */ | |
| export function isFeedbackSurveyDisabled(): boolean { | |
| return process.env.NODE_ENV === 'test' || isTelemetryDisabled() | |
| } | |