captureEvent

Validate and explicitly POST a Node lifecycle event with allowed metadata and a memory-only anonymous ID. Environment or programmatic opt-outs prevent sends. Sampling uses TPLANE_TELEMETRY_SAMPLE_RATE (default one) with a stable decision per ID and a reciprocal sample_weight. Requests use TPLANE_TELEMETRY_INGEST_URL or https://threadplane.ai/api/ingest, with a three-second abort timeout; rejected or failed captures return a reason.

import { captureEvent } from '@threadplane/telemetry/node';

Declaration · overload 1

export declare function captureEvent(event: ThreadplaneNodeEvent, properties?: Record<string, unknown>): Promise<CaptureResult>;

Parameters

event · required
ThreadplaneNodeEvent
properties · optional
Record<string, unknown>

Returns

Promise<CaptureResult>