elasticdash-js
v0.0.10
Published
ElasticDash JavaScript / TypeScript SDK
Readme
langfuse-js
Modular mono repo for the Langfuse JS/TS client libraries.
Packages
[!IMPORTANT] The SDK was rewritten in v4 and will be released soon. Refer to the v4 migration guide for instructions on updating your code.
| Package | NPM | Description | Environments |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ------------ |
| @elasticdash/client | | Langfuse API client for universal JavaScript environments | Universal JS |
| @elasticdash/tracing |
| Langfuse instrumentation methods based on OpenTelemetry | Node.js 20+ |
| @elasticdash/otel |
| Langfuse OpenTelemetry export helpers | Node.js 20+ |
| @elasticdash/openai |
| Langfuse integration for OpenAI SDK | Universal JS |
| @elasticdash/langchain |
| Langfuse integration for LangChain | Universal JS |
Documentation
Development
This is a monorepo managed with pnpm. See CONTRIBUTING.md for detailed development instructions.
Quick start:
pnpm install # Install dependencies
pnpm build # Build all packages
pnpm test # Run tests
pnpm ci # Run full CI suiteManual Tracing for Any Operation
You can manually record a trace for any operation (not just OpenAI) using the traceManualOperation function. This allows you to log input, output, and optional metadata such as session ID, feature ID, user ID, and tags.
Example:
import { traceManualOperation } from "@elasticdash/tracing";
traceManualOperation({
name: "user-login",
input: { username: "alice" },
output: { success: true, userId: "123" },
sessionId: "session-456",
featureId: "login-feature",
userId: "123",
tags: ["auth", "login"],
metadata: { ip: "127.0.0.1" },
});This will create a generation observation in ElasticDash tracing for the operation, making it easy to track and analyze custom workflows, API calls, or any business logic.
