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

@rawdash/connector-langfuse

v0.27.0

Published

Rawdash connector for Langfuse — LLM traces, daily observation volume and cost, and feedback scores

Readme

@rawdash/connector-langfuse

npm version license

Sync LLM traces, daily observation volume and cost by model, and feedback scores from a Langfuse project.

Install

npm install @rawdash/connector-langfuse

Authentication

A Langfuse public + secret API key pair scoped to one project is required. The connector authenticates over HTTP Basic auth (publicKey:secretKey).

  1. Open Langfuse -> Settings -> API Keys and create a new key pair for the project you want to sync.
  2. Copy both the public key (pk-lf-...) and the secret key (sk-lf-...). The secret is shown once.
  3. Set host to your instance base URL - https://cloud.langfuse.com (or the US/EU regional variants) for Langfuse Cloud, or your self-hosted origin (no trailing slash).
  4. Store the secret as a secret and reference it from config as secretKey: secret("LANGFUSE_SECRET_KEY"), alongside the plaintext publicKey.

Configuration

| Field | Type | Required | Description | | -------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | publicKey | string | Yes | Langfuse public API key for the project (starts with pk-lf-). Created in Langfuse -> Settings -> API Keys. | | secretKey | secret | Yes | Langfuse secret API key for the project (starts with sk-lf-). Issued alongside the public key in Langfuse -> Settings -> API Keys. | | host | string | No | Langfuse instance base URL. Use https://cloud.langfuse.com (US) or https://us.cloud.langfuse.com / https://eu.cloud.langfuse.com for Langfuse Cloud, or your self-hosted origin. No trailing slash. | | lookbackDays | number | No | How many calendar days of history to backfill on a full sync. Defaults to 30. | | resources | array | No | Which Langfuse resources to sync. Omit to sync all of them. |

Resources

  • langfuse_trace (entity) - LLM traces in the project, keyed by id, with name, owning user/session, optional release/version, aggregate cost in USD, aggregate latency in milliseconds, and the createdAt timestamp.
    • Endpoint: GET /api/public/traces
    • Traces upsert by id on every run. Trace input/output payloads are not stored.
    • name: Trace name set by the SDK.
    • projectId: Langfuse project id the trace belongs to.
    • userId: Attached userId, if any.
    • sessionId: Attached sessionId, if any.
    • release: Release identifier from the SDK, if set.
    • version: Version identifier from the SDK, if set.
    • totalCost: Aggregate trace cost in USD across all observations.
    • latencyMs: End-to-end trace latency in milliseconds.
    • createdAt: ISO timestamp of trace creation.
  • langfuse_observations_per_day (metric) - Daily LLM observation volume, total tokens, and total cost rolled up by model from the Langfuse daily metrics endpoint. One sample per (day, model) over the lookback window.
    • Endpoint: GET /api/public/metrics/daily
    • Unit: observations
    • Granularity: Daily (UTC)
    • Dimensions: model, countObservations, inputTokens, outputTokens, totalTokens, costUsd
    • Rollup metrics are stamped at UTC midnight of the day they cover.
  • langfuse_scores (metric) - Daily Langfuse score rollups by score name. One sample per (day, name): the mean numeric value across that day and the count of scores written.
    • Endpoint: GET /api/public/scores
    • Unit: scores
    • Granularity: Daily (UTC)
    • Dimensions: name, average, count
    • Only numeric scores contribute to the average; non-numeric scores still increment the count.

Example

import {
  defineConfig,
  defineDashboard,
  defineMetric,
  secret,
} from '@rawdash/core';

const langfuse = {
  name: 'langfuse',
  connectorId: 'langfuse',
  config: {
    publicKey: 'pk-lf-...',
    secretKey: secret('LANGFUSE_SECRET_KEY'),
    host: 'https://cloud.langfuse.com',
  },
};

export default defineConfig({
  connectors: [langfuse],
  dashboards: {
    llm: defineDashboard({
      widgets: {
        daily_observations: {
          kind: 'timeseries',
          title: 'LLM observations per day',
          window: '30d',
          metric: defineMetric({
            connector: langfuse,
            shape: 'metric',
            name: 'langfuse_observations_per_day',
            fn: 'sum',
          }),
        },
      },
    }),
  },
});

Rate limits

Langfuse Cloud applies per-project rate limits (around 1000 requests/min on paid plans); 429 responses with Retry-After are honored.

Limitations

  • One key pair scopes the sync to a single Langfuse project; sync multiple projects by adding one connector instance per project.
  • Trace bodies (input/output payloads) are not synced - only the trace envelope plus aggregated cost / token / latency.
  • Session and dataset endpoints are out of scope for the initial release.

Links

License

Apache-2.0