(event: string, data?: Record<string, unknown>)
| 1 | import { getBaseUrl } from "./api.js"; |
| 2 | |
| 3 | export function trackEvent(event: string, data?: Record<string, unknown>): void { |
| 4 | if (process.env.CTX7_TELEMETRY_DISABLED) return; |
| 5 | fetch(`${getBaseUrl()}/api/v2/cli/events`, { |
| 6 | method: "POST", |
| 7 | headers: { "Content-Type": "application/json" }, |
| 8 | body: JSON.stringify({ event, data }), |
| 9 | }).catch(() => {}); |
| 10 | } |
no test coverage detected