npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eidentic/langfuse

v0.1.4

Published

Langfuse OTLP tracing adapter for Eidentic — export agent spans to Langfuse with zero extra dependencies.

Readme

@eidentic/langfuse

Export Eidentic agent traces to Langfuse with zero extra dependencies.

langfuseTracer implements Eidentic's TracerPort interface, so it can be passed directly to new Agent({ tracer }). Spans are buffered in memory and flushed to Langfuse's OTLP/HTTP endpoint (/api/public/otel/v1/traces) using Basic auth — the only runtime dependency is fetch.

Installation

npm install @eidentic/langfuse

Usage

import { Agent } from "@eidentic/core";
import { langfuseTracer } from "@eidentic/langfuse";
import { AIModel } from "@eidentic/model";
import { SqliteStore } from "@eidentic/sqlite";
import { openai } from "@ai-sdk/openai";

const model = new AIModel(openai("gpt-4o-mini"));
const store = new SqliteStore();

const tracer = langfuseTracer({
  publicKey: process.env.LANGFUSE_PUBLIC_KEY!,
  secretKey: process.env.LANGFUSE_SECRET_KEY!,
  // Optional — defaults to https://cloud.langfuse.com (EU)
  // baseUrl: "https://us.cloud.langfuse.com",
});

const agent = new Agent({
  id: "my-agent",
  model,
  store,
  tracer,
});

for await (const event of agent.query("Hello!", { sessionId: "s-1" })) {
  if (event.type === "result") console.log(event.usage);
}

// Flush remaining spans and cancel the auto-flush timer on process exit.
await tracer.shutdown();

Options

| Option | Type | Default | Description | |---|---|---|---| | publicKey | string | required | Langfuse project public key (pk-lf-…) | | secretKey | string | required | Langfuse project secret key (sk-lf-…) | | baseUrl | string | https://cloud.langfuse.com | Langfuse base URL (no trailing slash). Use https://us.cloud.langfuse.com for the US region, or your self-hosted URL. | | flushAt | number | 20 | Buffer size threshold that triggers an automatic flush. | | flushInterval | number | 5000 | Max milliseconds between automatic flushes. | | fetchImpl | typeof fetch | globalThis.fetch | Override the fetch implementation (useful in tests). |

Spans emitted by Eidentic

The following span names are produced by @eidentic/core and will appear in Langfuse:

| Span name | Key attributes | |---|---| | gen_ai.invoke_agent | gen_ai.agent.id, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.usage.cached_input_tokens, eidentic.cost_usd, eidentic.kv_cache_hit_rate | | gen_ai.chat | gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens | | gen_ai.execute_tool | gen_ai.tool.name | | memory.ingest | eidentic.scope | | memory.retrieve | eidentic.scope |

All GenAI Semantic Convention attributes (gen_ai.*) are passed through unchanged, so Langfuse's model/token dashboards populate automatically.

Transport

Spans are sent to {baseUrl}/api/public/otel/v1/traces as POST requests with:

  • Content-Type: application/json
  • Authorization: Basic <base64(publicKey:secretKey)>
  • x-langfuse-ingestion-version: 4
  • Body: standard OTLP/HTTP JSON (ExportTraceServiceRequest)

Network errors are silently dropped to avoid crashing the agent.