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

@logcaffe/browser

v0.4.0

Published

Datadog/Sentry replacement browser SDK for SME/MSME teams. Self-hosted frontend monitoring, RUM, web vitals, and error tracking with data ownership.

Readme

@logcaffe/browser

npm License

Self-hosted Datadog/Sentry replacement browser SDK. Frontend monitoring, RUM Core Web Vitals, distributed tracing, error tracking, and breadcrumbs with data ownership.

npm install @logcaffe/browser

Quick start

import { LogCaffe } from '@logcaffe/browser';

LogCaffe.init({
  serverUrl: 'https://collector.your-logcaffe-host',
  apiKey: 'lc_<tenant>_<your-public-api-key>',
  environment: 'production',
  release: 'v2.4.1',

  captureErrors: true,         // window.onerror
  captureRejections: true,     // unhandledrejection
  captureConsole: false,       // console.error / warn → logs
  capturePerformance: true,
  captureNetwork: true,
  captureBreadcrumbs: true,

  enableTracing: true,
  enableRum: true,             // ← new in 0.4.0
});

That's it. Out of the box you now get:

  • Every uncaught error and unhandled promise rejection captured with stack + breadcrumbs.
  • Every fetch / XMLHttpRequest traced (with traceparent propagated to your backend).
  • Page load span (TTFB, DOM loaded, resource counts).
  • Click + navigation breadcrumbs leading up to each error.
  • Real User Monitoring (RUM) — Core Web Vitals (LCP, INP, CLS, TTFB, FCP) per page.

What's new in 0.4.0

RUM Core Web Vitals

LogCaffe.init({
  // ...
  enableRum: true,
  rumSampleRate: 1.0,                      // 0..1
  rumIgnorePaths: [/^\/internal/],          // skip these pages
});

Each page view captures LCP, INP, CLS, TTFB, FCP via the web-vitals library. Sessions are anonymized via a hashed device id (no PII). Geo enrichment happens server-side from the request IP (requires the collector's MaxMind GeoLite2 path).

The dashboard's RUM page shows per-URL p75 of each vital, color-coded against Google's "good / needs improvement / poor" thresholds.

React error boundary

import { LogCaffeErrorBoundary } from '@logcaffe/browser';

<LogCaffeErrorBoundary fallback={<ErrorPage />}>
  <App />
</LogCaffeErrorBoundary>

User context

import { LogCaffe } from '@logcaffe/browser';

LogCaffe.setUser({ id: 'u-42', email: '[email protected]' });
LogCaffe.addBreadcrumb({ category: 'ui.action', message: 'opened settings modal' });

Full configuration reference

LogCaffe.init({
  serverUrl: string,                       // required
  apiKey: string,                          // required (tenant-scoped)
  environment?: string,                    // default 'production'

  // Feature toggles
  captureErrors?: boolean,                 // window.onerror (default true)
  captureRejections?: boolean,             // unhandledrejection (default true)
  captureConsole?: boolean,                // console.error/warn (default false)
  capturePerformance?: boolean,            // navigation timing (default true)
  captureNetwork?: boolean,                // failed fetch/xhr (default true)

  // Enrichment
  release?: string,                        // app version
  captureBreadcrumbs?: boolean,            // default true
  maxBreadcrumbs?: number,                 // default 20
  captureDom?: boolean,                    // capture clicked element info
  captureNavigation?: boolean,             // route changes (default true)
  defaultTags?: string[],

  // Batching
  flushInterval?: number,                  // ms (default 10000)
  maxBatchSize?: number,                   // default 50

  // Sanitization
  sanitizeHeaders?: string[],              // additional header keys to redact
  sanitizeBodyKeys?: string[],

  // Filtering
  ignoreErrors?: (string | RegExp)[],
  ignoreUrls?: (string | RegExp)[],
  beforeSend?: (error) => error | null,

  // Tracing (existing)
  enableTracing?: boolean,                 // default false
  traceFlushInterval?: number,             // ms (default 10000)
  traceSampleRate?: number,                // 0..1 (default 1.0)
  traceIgnoreUrls?: (string | RegExp)[],
  capturePageLoad?: boolean,               // default true
  tracePropagateToOrigins?: (string | RegExp)[],

  // RUM (new in 0.4.0)
  enableRum?: boolean,                     // default false
  rumSampleRate?: number,                  // 0..1, default 1.0
  rumIgnorePaths?: (string | RegExp)[],
});

Manual logging

LogCaffe.debug('cache miss', { key: 'user:42' });
LogCaffe.info('checkout opened');
LogCaffe.warn('flaky network');
LogCaffe.error('payment widget failed to load', { component: 'PaymentForm' });

Compatibility

  • Modern evergreen browsers (Chromium, Firefox, Safari ≥ 14).
  • React peer dep is optional — only needed if you import LogCaffeErrorBoundary.
  • Compatible LogCaffe collector: >= 0.4.0.

Documentation

https://logcaffe.inhouse.electioncaffe.ai/docs/browser-sdk

License

MIT — see LICENSE.

Repository

https://github.com/logcaffe/LogCaffe