Track Vercel AI SDK (ai) calls with Lucidic telemetry
aiTelemetry()
is a convenience helper that returns a pre-configured telemetry object compatible with the AI SDK’s experimental_telemetry
option. It binds the current Lucidic session context so your generateText
/streamText
calls are captured as Lucidic events without additional setup.
experimental_telemetry: aiTelemetry()
to every AI SDK call to route spans to Lucidic (recommended for most use cases)init({ sessionName })
first; session context is attached via AsyncLocalStorage