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

@smarthivelabs-devs/observe-web

v26.3.0

Published

SmartObserve SDK for browsers, React, and Next.js

Readme

@smarthivelabs-devs/observe-web

Browser errors, sessions, and performance for SPAs, React, and Next.js. Failed ingest never throws into the page.

Use a public DSN (pk_) from SmartObserve project settings. Allow this site’s HTTPS origin on the project. Node backends use @smarthivelabs-devs/observe-node and an sk_ DSN.

https://<pk_public_key>@observe.smarthivelabs.dev/<project-slug>

Install

pnpm add @smarthivelabs-devs/observe-web

Start

Call init once on the client (not in a Node-only module).

import { SmartObserve } from "@smarthivelabs-devs/observe-web";

SmartObserve.init({
  dsn: process.env.NEXT_PUBLIC_SMARTOBSERVE_DSN,
  release: process.env.NEXT_PUBLIC_SMARTOBSERVE_RELEASE,
});

window.onerror, unhandled rejections, fetch, navigation, LCP/FCP, console, and a session (active / exited) are captured automatically. Events queue while offline and flush when the tab is back online.

What you send

SmartObserve.captureException(err);
SmartObserve.captureMessage("paywall shown", "info");
SmartObserve.log.warn("slow image", { src });

SmartObserve.setUser({ id: user.id });
SmartObserve.setTag("plan", user.plan);
SmartObserve.setContext("page", { route: location.pathname });
SmartObserve.addBreadcrumb({ category: "ui", message: "opened cart" });

await SmartObserve.startSpan({ name: "load-profile", operation: "ui.action" }, async (span) => {
  span.setAttribute("user.id", user.id);
  return loadProfile();
});

beforeSend can drop or edit events. Passwords, tokens, and cookies are redacted; extend with redactKeys. Email and IP stay off the user object unless sendDefaultPii: true.

Browser noise nobody can act on (extension scripts, ResizeObserver loop warnings, cross-origin Script error.) is dropped by default; set ignoreDefaultErrors: false to keep it. Chunk-load failures and network errors are tagged error.kind:chunk_load / error.kind:network, and every chunk-load failure groups into one issue instead of one per chunk file.

After a deploy, tabs still running the previous build hit ChunkLoadError. Set reloadOnChunkError: true to report it and reload the page once (at most once a minute), so users land on the new build.

Turn off noisy automations with trackFetch, trackNavigation, trackPerformance, or trackConsole set to false. Ignore third-party script noise with denyUrls.

Outgoing fetch never gets traceparent unless you allow hosts you own:

SmartObserve.init({
  dsn: process.env.NEXT_PUBLIC_SMARTOBSERVE_DSN,
  allowTracePropagationTargets: ["https://api.yourapp.com"],
});

User feedback

Let users tell you what went wrong. Feedback shows up in the dashboard's User Feedback inbox, and on the issue when it is attached to an error.

// A floating "Report a problem" button on every page:
SmartObserve.init({ dsn: process.env.NEXT_PUBLIC_SMARTOBSERVE_DSN, feedbackButton: true });

// Or open the dialog yourself, attached to an error:
const eventId = SmartObserve.captureException(error);
SmartObserve.showFeedbackDialog({ associatedEventId: eventId, name: user.name, email: user.email });

// Or send feedback from your own form:
SmartObserve.captureFeedback({ message, email, associatedEventId: eventId });

With React, <SmartObserveErrorBoundary showDialog fallback={…}> opens the dialog after a crash, attached to that error. The dialog renders in a Shadow DOM, follows the user's light/dark preference, and is keyboard and screen-reader accessible.

React

Wrap the tree you care about. Uncaught render errors become issues with a component stack.

import { SmartObserveErrorBoundary } from "@smarthivelabs-devs/observe-web/react";

<SmartObserveErrorBoundary fallback={<p>Something broke.</p>}>
  <App />
</SmartObserveErrorBoundary>

Next.js

withSmartObserve injects NEXT_PUBLIC_SMARTOBSERVE_* and, on production webpack builds, uploads .map files so stack frames symbolicate.

import { withSmartObserve } from "@smarthivelabs-devs/observe-web/next";

export default withSmartObserve(nextConfig, {
  dsn: process.env.SMARTOBSERVE_DSN,
});

In CI set SMARTOBSERVE_AUTH_TOKEN to a release token from project settings (SMARTOBSERVE_RELEASE_TOKEN also works). Release defaults to SMARTOBSERVE_RELEASE, then VERCEL_GIT_COMMIT_SHA / CF_PAGES_COMMIT_SHA. Fail the build on upload errors with requireUpload: true. Keep maps locally with deleteAfterUpload: false.

next is an optional peer. Vanilla React / Vite apps only need the root package plus /react if you want the boundary.

Options

| Option | Default | Notes | | --- | --- | --- | | dsn | NEXT_PUBLIC_SMARTOBSERVE_DSN | Public key DSN | | release | NEXT_PUBLIC_SMARTOBSERVE_RELEASE | Tie events to a deploy | | enabled | true if DSN is set | Set false in tests | | errorSampleRate | 1 | 0–1 | | tracesSampleRate | 0.1 | Root transactions | | sendDefaultPii | false | Include email / IP | | debug | false | Logs transport failures |

API

SmartObserve.init · captureException · captureMessage · log · setUser · setTag · setContext · addBreadcrumb · startSpan · beforeSend · flush · close · SmartObserveBrowserClient