MCPcopy Create free account
hub / github.com/TanStack/cli / postEvent

Function postEvent

packages/cli/src/telemetry.ts:173–193  ·  view source on GitHub ↗
(event: string, distinctId: string, properties: TelemetryProperties)

Source from the content-addressed store, hash-verified

171}
172
173async function postEvent(event: string, distinctId: string, properties: TelemetryProperties) {
174 const controller = new AbortController()
175 const timeout = setTimeout(() => {
176 controller.abort()
177 }, TELEMETRY_TIMEOUT_MS)
178
179 try {
180 await fetch(TELEMETRY_TRANSPORT_ENDPOINT, {
181 method: 'POST',
182 headers: {
183 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
184 },
185 body: createTelemetryRequestBody(event, distinctId, properties),
186 signal: controller.signal,
187 })
188 } catch {
189 // Telemetry must never affect CLI behavior.
190 } finally {
191 clearTimeout(timeout)
192 }
193}
194
195export class TelemetryClient {
196 private commandProperties: TelemetryProperties = {}

Callers 3

captureCommandStartedMethod · 0.85
captureCommandFailedMethod · 0.85

Calls 2

abortMethod · 0.65

Tested by

no test coverage detected