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

@bugwalk/browser

v0.2.3

Published

Browser SDK for Bugwalk: page views, clicks, fetch, and uncaught errors

Readme

@bugwalk/browser

Browser SDK for Bugwalk. Records page views, clicks, network requests, and uncaught errors, and ties them to a person so you can replay what they actually did before something broke.

If you use React, Vue, Svelte, Angular, Next.js, or Nuxt, install the adapter for your framework instead — it wraps this package and hooks the framework's own error handling.

Install

npm install @bugwalk/browser

Use

import { init, identify, capture } from '@bugwalk/browser';

init({ dsn: import.meta.env.VITE_BUGWALK_DSN });

// once you know who is signed in
identify({ id: user.id, email: user.email });

// anything the automatic capture cannot infer
capture('checkout_failed', { orderId });

Call init as early as possible, before your app mounts. On the server it returns undefined and does nothing, so no typeof window guard is needed.

Without a build step

<script src="https://cdn.bugwalk.app/v1/browser.min.js"></script>
<script>
  Bugwalk.init({ dsn: 'hs_pub_...' });
</script>

Same code as the npm package, 6.8 kB gzipped.

What is captured automatically

| | | | --- | --- | | Page views and navigation | Including pushState routing, so single-page apps work | | Clicks | On buttons, links, and anything with a click role, with the element's visible label | | fetch and XMLHttpRequest | Method, URL, status, and duration | | Uncaught errors | window.onerror and unhandledrejection, with parsed stack frames |

Each of these can be turned off: init({ dsn, captureClicks: false }).

Joining the frontend to the backend

Same-origin requests get a W3C traceparent header and an x-bugwalk-session header. Your backend SDK reads both, which is what puts a failed API call and the click that caused it on one timeline.

To instrument a separate API origin, list it and allow the two headers in that server's CORS configuration:

init({ dsn, tracePropagationTargets: ['https://api.example.com'] });

Passing tracePropagationTargets replaces the same-origin default, so include your own origin if you want both.

Redaction

Authorization headers, cookies, password-like keys, card numbers, and tokens are stripped inside the browser, before anything is sent. See the redaction rules.

For anything specific to your app:

init({
  dsn,
  beforeSend(event) {
    if (event.payload?.url?.includes('/internal/')) return null; // drop it
    return event;
  },
});

Session handling

A session lasts until 30 minutes of inactivity. Call resetSession() on logout so the next person to use the browser gets their own journey.

API

| Function | Purpose | | --- | --- | | init(options) | Start recording. Safe to call more than once. | | identify(person) | Attach an id or email to everything from here on. | | capture(name, payload?) | Record a custom event. | | captureError(error) | Record an error you already caught. | | flush() | Send what is buffered and wait for it. | | resetSession() | End the visit and start a new one. | | shutdown() | Stop recording and remove every listener. |

Apache-2.0