Installation

To install the Latitude SDK, use your preferred package manager:

npm install @latitude-data/sdk
# or
yarn add @latitude-data/sdk
# or
pnpm add @latitude-data/sdk

Usage

Vercel AI SDK is supported through Latitude’s custom Vercel integration. To use it, you need to install the @latitude-data/telemetry package:

npm install @latitude-data/telemetry
# or
yarn add @latitude-data/telemetry
# or
pnpm add @latitude-data/telemetry

Then, you can initialize the Latitude SDK passing the Vercel processor:

import { VercelBatchSpanProcessor } from '@latitude-data/telemetry'
import { Latitude } from '@latitude-data/sdk'

new Latitude('your-api-key-here', {
  telemetry: {
    processors: [VercelBatchSpanProcessor],
  },
})

Latitude’s Vercel integration already traces all LLM calls made with Vercel’s AI SDK, you should remove any other Latitude instrumentation from your project in order to avoid generating duplicated traces.