This guide explains how to instrument HoneyHive in a NextJS application that uses the Vercel AI SDK and Sentry.
sentry.<client, server, edge>.config.ts
filessessionId
and pass it to your AI SDK call to link multiple AI SDK requests to the same user session.OTEL_EXPORTER_OTLP_ENDPOINT
is the HoneyHive API endpoint for consuming NextJS telemetry data.
HH_API_KEY
is the HoneyHive API key.
HH_PROJECT_NAME
is the HoneyHive project name.
If setting these in your .env
file, make sure to reload your application after setting the variables.
sentry.client.config.ts
sentry.server.config.ts
sentry.edge.config.ts
sessionId
and passing it to your AI SDK call.
A valid sessionId
is a random uuidv4 string.
For example, you can generate a sessionId when your client-side page is mounted:
First, install uuid
:
sessionId
will help us link multiple traces to the same user session.
You can find a complete example of this integration in our NextJS Cookbook.