API Reference
Full type and method reference for @mediquo/telemetry.
MediquoTelemetryClient
The main client class. Instantiate once per application.
import { MediquoTelemetryClient } from "@mediquo/telemetry";
const telemetry = new MediquoTelemetryClient();Methods
setApiKey(key: string): void
Initializes the HTTP transport with the given API key. Must be called before any track() call.
telemetry.setApiKey("your-api-key");track(event: TelemetryEvent): void
Sends an event. Fire-and-forget — delivery errors are suppressed and do not throw.
telemetry.track({
action_type: "pageview",
event_type: "screen_viewed",
screen: "appointment_list",
});Types
TelemetryEvent
The payload passed to track().
type TelemetryEvent = {
action_type: TelemetryEventActionType;
event_type: string;
[key: string]: unknown;
};| Field | Type | Description |
|---|---|---|
action_type | TelemetryEventActionType | Classifies the event. See values below. |
event_type | string | Identifier for the specific event (e.g. "appointment_booked"). |
...rest | unknown | Any additional properties are forwarded as-is to the tracking endpoint. |
TelemetryEventActionType
type TelemetryEventActionType = "event" | "pageview" | "debug";| Value | Description |
|---|---|
"event" | User-initiated action |
"pageview" | Route or screen change |
"debug" | Development-only diagnostic |