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

@dispatchitapp/browser

v1.0.0

Published

Browser error tracker for Dispatch: cross-browser stack parsing, breadcrumbs, user path, and a fetch-keepalive/sendBeacon transport.

Downloads

153

Readme

@dispatchitapp/browser

The browser error tracker for Dispatch. Captures uncaught errors and unhandled promise rejections (Sentry-shaped, platform: "javascript") with breadcrumbs and the user path, and ships them via fetch keepalive — falling back to navigator.sendBeacon on unload. This entry is the error tracker only; the feedback widget ships separately so you can include error tracking without the modal DOM.

ESM / bundler

import { init } from "@dispatchitapp/browser";

init({
  apiKey: "dsp_live_...",
  endpoint: "https://acme.dispatchit.app/api/v1/tickets", // errors go to the derived /store
  environment: "production",
  release: import.meta.env.VITE_GIT_SHA,
  // captureClicks: true (default), captureConsole: false (default)
});

No-build <script> drop-in

<script type="application/json" id="dispatch-config">
  { "apiKey": "dsp_live_...", "endpoint": "https://acme.dispatchit.app/api/v1/store",
    "environment": "production" }
</script>
<script src="https://cdn.dispatchit.app/dispatch.browser.global.js"></script>

The CDN bundle exposes window.Dispatch and auto-initialises from that config tag (or window.__dispatchConfig). window.Dispatch.captureException(err) is available for manual capture.

What it captures

  • Uncaught errors (mechanism.type: "onerror") and unhandled rejections (mechanism.type: "onunhandledrejection") — handled: false.
  • A real cross-browser stack parser (Chrome/V8, Firefox/Safari, async + anonymous frames, with column numbers) — a proper replacement for the gem's 3-regex error_tracker.js.
  • Breadcrumbs (clicks + optional console.error) and the user_path (last few clicks).
  • The page url + User-Agent, plus your configured user, tags, release, sampling and beforeSend.

Output validates against ../../contract/schema/event.schema.json (test/index.test.ts).

Feedback widget

A separate entry, @dispatchitapp/browser/widget, renders the floating 💬 button + modal where a user reports a bug, requests a feature, or suggests a change (a framework-free rebuild of the gem's widget). Import it independently so a page can ship the widget, the error tracker, or both:

import { initWidget } from "@dispatchitapp/browser/widget";

initWidget({
  apiKey: "dsp_live_...",
  endpoint: "https://acme.dispatchit.app/api/v1/tickets",
  user: () => currentUser && { email: currentUser.email, external_id: currentUser.id },
  severity: "high",            // default severity + metadata.severity_hint for this surface
  labels: ["checkout"],         // → metadata.labels
});

It captures screenshots (file picker, drag & drop, paste → base64; max 5, 5 MB each), the page URL/user-agent/viewport/referrer, the click user_path, and optional console_errors, then POSTs a { ticket } (with Idempotency-Key + X-Dispatch-Widget-Version) — matching the golden ticket.widget.json. There's also a dispatch.widget.global.js <script> drop-in that auto-mounts from a #dispatch-widget-config tag.

Scripts

pnpm test · pnpm typecheck · pnpm build   # build emits ESM + CJS + d.ts and a minified IIFE