@langfuse/core
v5.11.0
Published
Core functions and utilities for Langfuse packages
Keywords
Readme
@langfuse/core
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.
[!IMPORTANT] This is the current SDK generation (
@langfuse/*scoped packages). The unscopedlangfuse-corenpm package belongs to the legacy v3 SDK. Migration guides: v3 → v4, v4 → v5.
Environment variables
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.comPackages
| 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 |
Documentation
- Docs: https://langfuse.com/docs/observability/sdk/overview
- Reference: https://js.reference.langfuse.com
- LLM/agent-readable docs index: https://langfuse.com/llms.txt
