This example repo demostrates how to use Langfuse to instrument a NextJs app with the Vercel AI SDK. This repo is based on the next-openai example.
Relevant Files:
next.config.js
- Enableexperimental.instrumentationHook
instrumentation.ts
- Register theLangfuseExporter
app/routes/api/*
- Enableexperimental_telemetry
in AI SDK routes
See the integration docs for more information and a step-by-step guide: https://langfuse.com/docs/integrations/vercel-ai-sdk