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

bugwatch-sdk-js

v0.1.1

Published

Official dependency-free JavaScript SDK for Bugwatch error tracking (browser + Node.js)

Readme

bugwatch-sdk-js

Official dependency-free JavaScript SDK for Bugwatch error tracking. Works in the browser and in Node.js (>=14), with no build step and no runtime dependencies.

It defines the global Bugwatch object and also ships CommonJS + ESM entry points with TypeScript types. Transport is fetch() with keepalive: true only — never sendBeacon (it cannot set X-Bugwatch-Key). HTTPS is required unless allowHttp: true. Email, IP and usernames are not sent unless sendDefaultPii: true. Bugwatch.flush() waits for in-flight requests.

Install

npm install bugwatch-sdk-js

Or copy bugwatch.js to your server and include it before your app code:

<script src="/static/bugwatch.js"></script>

Usage

Browser (global)

<script src="/static/bugwatch.js"></script>
<script>
  Bugwatch.init({
    dsn: "https://[email protected]/api/1",
    environment: "production",
    release: "1.2.3",
    sampleRate: 1.0
  });

  try {
    throw new Error("Payment declined");
  } catch (err) {
    Bugwatch.captureException(err, {
      tags: { module: "checkout" },
      user: { id: "42", email: "[email protected]" }
    });
  }

  Bugwatch.captureMessage("Cart confirmed", {
    level: "info",
    tags: { feature: "cart" }
  });

  Bugwatch.flush();
</script>

Node.js (CommonJS)

const Bugwatch = require("bugwatch-sdk-js");

Bugwatch.init({
  dsn: "https://[email protected]/api/1",
  environment: "production"
});

Bugwatch.captureException(new Error("boom"));
Bugwatch.flush();

ESM / TypeScript

import Bugwatch from "bugwatch-sdk-js";

Bugwatch.init({
  dsn: "https://[email protected]/api/1"
});

const eventId = Bugwatch.captureException(new Error("boom"));

API

| Method | Description | | --- | --- | | Bugwatch.init(options) | Configure the SDK. Returns true when the DSN was accepted. | | Bugwatch.captureException(error, {tags, user}) | Capture an exception (Error or string). Returns event_id or null. | | Bugwatch.captureMessage(message, {level, tags, user}) | Capture a message. Returns event_id or null. | | Bugwatch.setUser(user) | Set the current user. | | Bugwatch.setTag(key, value) | Add a current tag. | | Bugwatch.setContext(context) | Set context (including an optional request key). | | Bugwatch.flush(timeoutMs) | Wait for in-flight sends (default 5000 ms). |

init options: dsn, environment, release, sampleRate, debug, sendDefaultPii, allowHttp.

DSN format

https://{public_key}@{host}/api/{project_id}

The SDK POSTs JSON to {dsn}/store/ with header X-Bugwatch-Key: {public_key}. platform is "javascript"; the stacktrace is parsed from error.stack.

Development

npm test          # run the test suite
npm run prepublishOnly  # runs before every npm publish

License

MIT