MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / trackEvent

Function trackEvent

packages/cli/src/telemetry/client.ts:66–98  ·  view source on GitHub ↗
(
  event: string,
  properties: EventProperties = {},
  distinctId?: string,
)

Source from the content-addressed store, hash-verified

64 * Queue a telemetry event. Non-blocking, fail-silent.
65 */
66export function trackEvent(
67 event: string,
68 properties: EventProperties = {},
69 distinctId?: string,
70): void {
71 if (!shouldTrack()) return;
72
73 const sys = getSystemMeta();
74 eventQueue.push({
75 event,
76 distinctId,
77 properties: {
78 ...properties,
79 cli_version: VERSION,
80 os: process.platform,
81 arch: process.arch,
82 node_version: process.version,
83 os_release: sys.os_release,
84 cpu_count: sys.cpu_count,
85 cpu_model: sys.cpu_model ?? undefined,
86 cpu_speed: sys.cpu_speed ?? undefined,
87 memory_total_mb: sys.memory_total_mb,
88 is_docker: sys.is_docker,
89 is_ci: sys.is_ci,
90 ci_name: sys.ci_name ?? undefined,
91 is_wsl: sys.is_wsl,
92 is_tty: sys.is_tty,
93 sandbox_runtime: sys.sandbox_runtime ?? undefined,
94 agent_runtime: sys.agent_runtime ?? undefined,
95 },
96 timestamp: new Date().toISOString(),
97 });
98}
99
100/**
101 * Drain the in-memory queue into a PostHog `/batch/` payload string.

Callers 14

events.test.tsFile · 0.70
trackCommandFunction · 0.70
trackRenderCompleteFunction · 0.70
trackRenderErrorFunction · 0.70
trackRenderObservationFunction · 0.70
trackInitTemplateFunction · 0.70
trackBrowserInstallFunction · 0.70
trackCliErrorFunction · 0.70
trackRenderFeedbackFunction · 0.70

Calls 2

getSystemMetaFunction · 0.85
shouldTrackFunction · 0.70

Tested by

no test coverage detected