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

@devfellowship/observability

v2.1.0

Published

Browser observability SDK — OpenTelemetry + Sentry for React apps

Readme

@devfellowship/observability

Browser observability SDK for React apps. Provides OpenTelemetry tracing, metrics, Sentry error tracking, Web Vitals, fetch instrumentation, error boundaries, and React Query error reporting — all via a single provider wrapper.

Install

npm install @devfellowship/observability

Peer dependencies

  • react >= 18
  • @tanstack/react-query >= 5 (optional — enables automatic query error reporting)

Quick start

Wrap your app with <ObservabilityProvider>:

import { ObservabilityProvider } from "@devfellowship/observability";

function App() {
  return (
    <ObservabilityProvider>
      <YourApp />
    </ObservabilityProvider>
  );
}

With zero props, the provider reads configuration from Vite environment variables:

| Env var | Purpose | |---------|---------| | VITE_APP_NAME | Service name for traces/metrics | | VITE_APP_VERSION | Service version | | VITE_OTEL_API_KEY | API key sent as x-api-key header | | VITE_SENTRY_DSN | Sentry DSN (enables error tracking + session replay) | | VITE_OTEL_ENABLED | Set to "true" to enable (auto-enabled in production) |

Explicit configuration

All settings can be passed as props, overriding env vars:

<ObservabilityProvider
  serviceName="my-app"
  serviceVersion="1.2.0"
  collectorUrl="https://otel.devfellowship.com"
  apiKey="your-api-key"
  sentryDsn="https://[email protected]/yyy"
  environment="production"
  enabled={true}
  enableWebVitals={true}
  enableQueryTracking={true}
  enableFetchTracing={true}
>
  <App />
</ObservabilityProvider>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | serviceName | string | VITE_APP_NAME or "unknown" | Service name for OTel resource | | serviceVersion | string | VITE_APP_VERSION or "0.0.0" | Service version | | collectorUrl | string | "https://otel.devfellowship.com" | OTel collector base URL | | apiKey | string | VITE_OTEL_API_KEY | API key header value | | sentryDsn | string | VITE_SENTRY_DSN | Sentry DSN (omit to disable Sentry) | | environment | string | "production" / "development" | Environment label | | enabled | boolean | true in production | Master kill-switch | | enableWebVitals | boolean | true | Capture LCP, CLS, INP, TTFB | | enableQueryTracking | boolean | true | Report React Query errors as spans | | enableFetchTracing | boolean | true | Auto-trace all fetch() calls |

Utilities

Track custom events

import { trackEvent } from "@devfellowship/observability";

trackEvent("button_click", { "button.id": "checkout", page: "/cart" });

Set user context

import { setUserId, setUserRole } from "@devfellowship/observability";

// After authentication
setUserId(user.id);
setUserRole(user.role);

Sentry helpers

import { captureError, setSentryUser } from "@devfellowship/observability";

captureError(new Error("something broke"), { component: "Checkout" });
setSentryUser(user.id, user.role);

Error boundary

import { ErrorBoundary } from "@devfellowship/observability";

<ErrorBoundary fallback={<p>Something went wrong</p>}>
  <RiskyComponent />
</ErrorBoundary>

What's included

  • OTel tracesBatchSpanProcessor → OTLP/HTTP exporter
  • OTel metricsPeriodicExportingMetricReader → OTLP/HTTP exporter
  • Fetch instrumentation — auto-creates spans for all fetch() calls (collector URLs filtered)
  • Web Vitals — LCP, CLS, INP, TTFB reported as OTel histogram metrics
  • Sentry — error tracking, session replay (on-error), browser tracing
  • Error boundary — catches React component errors, reports to both OTel and Sentry
  • React Query integration — subscribes to query cache, creates error spans on failures
  • Resource attributes — browser, OS, device type, session ID, viewport, connection type, route

Development

npm install
npm run build    # builds with tsup (ESM + .d.ts)

Publishing

npm version patch  # or minor/major
npm publish

License

MIT