langfuse-langchain
v3.39.2
Published
LEGACY Langfuse v3 integration for LangChain (maintenance mode). For new projects use the current CallbackHandler from @langfuse/langchain: npm install @langfuse/langchain @langfuse/otel
Readme
Langfuse JS/TS
[!IMPORTANT] This package is not the latest Langfuse JS/TS SDK.
langfuse-langchainis the deprecated v3 LangChain integration. Do not use it for new instrumentation.Latest setup:
npm install @langfuse/langchain @langfuse/otel @opentelemetry/sdk-nodeand useCallbackHandlerfrom@langfuse/langchain. Docs: https://langfuse.com/integrations/frameworks/langchain — Upgrade: v3 → v4, v4 → v5.Query traces with Observations API v2 (
GET /api/public/v2/observations, API reference), notGET /api/public/traces/api.traceList.Data freshness: the only real-time path is OpenTelemetry ingestion (
@langfuse/otel, or any OTel exporter sendingx-langfuse-ingestion-version: 4) combined with the Observations API v2 and Metrics API v2. All other GET APIs from all SDK packages can be up to 10 minutes behind.
This is the JS/TS client for the Langfuse Langchain integration.
Documentation
- Docs: https://langfuse.com/docs/integrations/langchain
- Reference: https://js.reference.langfuse.com/modules/langfuse_langchain.html
Environments
Supported
- Node.js >=20
- Web
- Edge: Vercel, Cloudflare Workers, etc.
Installation
npm i langfuse-langchain
# or
yarn add langfuse-langchain
# or
pnpm i langfuse-langchain