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

@open-infra/telemetry-browser

v0.2.0

Published

Privacy-first browser OpenTelemetry runtime with owned instrumentation and bounded offline traces.

Downloads

429

Readme

@open-infra/telemetry-browser

Consent-aware browser traces, logs, and metrics using official OpenTelemetry providers. Includes bounded offline trace replay and privacy filtering.

Install

npm install @open-infra/telemetry-browser

Use a browser bundler. Start only after window and document exist. React and Vue bindings are separate packages: @open-infra/telemetry-browser-react and @open-infra/telemetry-browser-vue.

Configure a server-controlled gateway

import { createBrowserTelemetry } from '@open-infra/telemetry-browser';

const telemetry = createBrowserTelemetry({
  serviceName: 'storefront',
  projectId: 'commerce',
  consent: 'unknown',
  exporter: {
    traceEndpoint: '/v1/traces',
    logEndpoint: '/v1/logs',
    metricEndpoint: '/v1/metrics',
  },
});
await telemetry.start();

// Invoke after the user grants your application's telemetry consent.
await telemetry.setConsent('granted');
telemetry.logger.info('checkout.started');
telemetry.telemetryMetrics.counter('checkout.started');

Your server must route these endpoints to an OTLP/HTTP protobuf receiver. It should authenticate the session, enforce origin/rate/size limits, and attach backend credentials. Never put privileged exporter keys in browser JavaScript. Cross-origin exporters require exporter.allowedOrigins and compatible CORS/CSP configuration.

Consent and persistence

Collection starts only with granted consent. denied clears queued offline traces and permits a later grant. revoked clears data and is terminal for the controller. Every grant starts a new collection epoch.

Offline traces use bounded IndexedDB storage by default; set offline: { enabled: false } to disable it. Logs and metrics remain memory-only. Replayed traces retain original timestamps and carry telemetry.replayed=true. Delivery is at least once; duplicates and losses are possible. Browser storage availability and eviction are outside the SDK's control.

Runtime lifecycle

Create one global runtime per page. Call forceFlush() when necessary and shutdown() for explicit teardown. Shutdown does not allow another global runtime to replace it; reload the page. registerGlobal: false supports isolated tests with explicitly supplied providers.

Fetch, XHR, page loading, errors, navigation, and web vitals are enabled by default; interaction capture is opt-in. Review policy, instrumentation, queue limits, and sampling for your application. Never use user/session/request IDs as metric dimensions.

Operations · Delivery semantics

Apache-2.0.