npm.io
6.0.1 β€’ Published 3d ago

@langfuse/core

Licence
MIT
Version
6.0.1
Deps
0
Size
4.2 MB
Vulns
0
Weekly
0
Stars
170

GitHub Banner

@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.

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.

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.com

Packages

Package NPM Description Environments
@langfuse/tracing NPM OpenTelemetry-based tracing instrumentation Node.js 22+
@langfuse/otel NPM LangfuseSpanProcessor to export OpenTelemetry spans to Langfuse Node.js 22+
@langfuse/client NPM Prompt management, datasets, experiments, scores, full REST API Universal JS
@langfuse/openai NPM observeOpenAI wrapper for tracing the OpenAI SDK Universal JS
@langfuse/langchain NPM CallbackHandler for LangChain / LangGraph tracing Universal JS
@langfuse/vercel-ai-sdk NPM Telemetry integration for Vercel AI SDK v7 Universal JS
@langfuse/browser NPM Browser score ingestion with public-key auth Browser
@langfuse/core NPM Shared core: generated API client, logger, utilities Universal JS

Documentation

License

MIT