MCPcopy
hub / github.com/upstash/context7 / trackEvent

Function trackEvent

packages/cli/src/utils/tracking.ts:3–10  ·  view source on GitHub ↗
(event: string, data?: Record<string, unknown>)

Source from the content-addressed store, hash-verified

1import { getBaseUrl } from "./api.js";
2
3export 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}

Callers 15

resolveCommandFunction · 0.85
queryCommandFunction · 0.85
generateCommandFunction · 0.85
removeCommandFunction · 0.85
installCommandFunction · 0.85
searchCommandFunction · 0.85
listCommandFunction · 0.85
removeCommandFunction · 0.85
infoCommandFunction · 0.85
suggestCommandFunction · 0.85
loginCommandFunction · 0.85
logoutCommandFunction · 0.85

Calls 1

getBaseUrlFunction · 0.85

Tested by

no test coverage detected