UNPKG

ai

Version:

AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.

16 lines (13 loc) 483 B
import type { Telemetry } from './telemetry'; /** * Registers one or more telemetry integrations globally. */ export function registerTelemetry(...integrations: Telemetry[]): void { if (!globalThis.AI_SDK_TELEMETRY_INTEGRATIONS) { globalThis.AI_SDK_TELEMETRY_INTEGRATIONS = []; } globalThis.AI_SDK_TELEMETRY_INTEGRATIONS.push(...integrations); } export function getGlobalTelemetryIntegrations(): Telemetry[] { return globalThis.AI_SDK_TELEMETRY_INTEGRATIONS ?? []; }