Langfuse is the open-source LLM engineering platform: tracing & evaluation for AI and agent applications, prompt management, datasets & experiments, and evaluation (scores). This is the shared core package of the Langfuse JS SDK: the generated REST API client (LangfuseAPIClient), logger, environment-variable handling, media types, and the propagateAttributes context propagation utilities. Use @langfuse/tracing + @langfuse/otel for tracing and @langfuse/client for prompt management, datasets/experiments, and scores.
This is the current SDK generation (@langfuse/* scoped packages). The unscoped langfuse-core npm package belongs to the legacy v3 SDK. Migration guides: v3 β v4, v4 β v5.
Configuration shared across all @langfuse/* packages:
LANGFUSE_PUBLIC_KEY="pk-lf-..."
LANGFUSE_SECRET_KEY="sk-lf-..."
LANGFUSE_BASE_URL="https://cloud.langfuse.com" # πͺπΊ EU region. πΊπΈ US: https://us.cloud.langfuse.com, π―π΅ Japan: https://jp.cloud.langfuse.com, βοΈ HIPAA: https://hipaa.cloud.langfuse.com
| Package | NPM | Description | Environments |
|---|---|---|---|
| @langfuse/tracing | OpenTelemetry-based tracing instrumentation | Node.js 20+ | |
| @langfuse/otel | LangfuseSpanProcessor to export OpenTelemetry spans to Langfuse |
Node.js 20+ | |
| @langfuse/client | Prompt management, datasets, experiments, scores, full REST API | Universal JS | |
| @langfuse/openai | observeOpenAI wrapper for tracing the OpenAI SDK |
Universal JS | |
| @langfuse/langchain | CallbackHandler for LangChain / LangGraph tracing |
Universal JS | |
| @langfuse/vercel-ai-sdk | Telemetry integration for Vercel AI SDK v7 | Universal JS | |
| @langfuse/browser | Browser score ingestion with public-key auth | Browser | |
| @langfuse/core | Shared core: generated API client, logger, utilities | Universal JS |