Vercel AI SDK Integration
The TypeScript SDK supports Vercel AI SDK via OpenTelemetry spans created by the AI SDK when you pass a tracer.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.
Setup
Streaming
Tools
Notes
- Pass
experimental_telemetry: aiTelemetry()
to every AI SDK call to route spans to Lucidic (recommended for most use cases) - Use
init({ sessionName })
first; session context is attached via AsyncLocalStorage - Images in messages are handled by the AI SDK and extracted by Lucidic