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

@drilonhametaj/observer-browser

v0.1.0-alpha.1

Published

Browser SDK for the Observer SDK. Auto-tracks errors, network, clicks, navigation, and behavioural anomalies. Embed in any Next.js host app.

Readme

@drilonhametaj/observer-browser

Browser SDK for the Observer SDK. Auto-tracks errors, network failures, behavioural anomalies, and console output in any web app — and ships them to your host's /api/observer/ingest endpoint with traceId correlation.

Status: alpha. Only safe to use in dev environments.

Install

pnpm add @drilonhametaj/observer-browser

Requires react@>=18 if you use the React adapter.

Quickstart (Next.js App Router)

// app/layout.tsx
import { ObserverProvider } from '@drilonhametaj/observer-browser/react'

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <ObserverProvider
          config={{
            endpoint: '/api/observer/ingest',
            apiKey: process.env.NEXT_PUBLIC_OBSERVER_KEY!,
            environment: 'development',
          }}
        >
          {children}
        </ObserverProvider>
      </body>
    </html>
  )
}

That's it. The SDK now captures:

  • js_error — uncaught exceptions
  • promise_rejection — unhandled rejections
  • http — every fetch (with traceparent header injected for backend correlation)
  • click — every click, with rage/dead-click detection
  • consoleconsole.warn and console.error
  • navigation — SPA route changes

Manual capture

import { Observer } from '@drilonhametaj/observer-browser'

Observer.captureException(error, { context: 'user-payload-handler' })
Observer.captureMessage('user clicked retry', 'info')
Observer.addBreadcrumb({ category: 'auth', action: 'login.success' })
Observer.setUser({ id: 'u_42', email: '[email protected]', role: 'admin' })

Expectations

Track flows that should complete within a window:

Observer.expect('save-cantiere', { within: 5_000 })
try {
  await api.saveCantiere(data)
  Observer.fulfilled('save-cantiere')
} catch (err) {
  Observer.failed('save-cantiere', String(err))
  throw err
}

If fulfilled doesn't fire within 5s, an expectation_unmet incident is created server-side.

Error boundary

import { ObserverErrorBoundary } from '@drilonhametaj/observer-browser/react'

<ObserverErrorBoundary boundary="UserDashboard" fallback={<MyErrorUI />}>
  <Dashboard />
</ObserverErrorBoundary>

Bundle size

Core entry target: <30KB gzipped. rrweb (session replay) is lazy-loaded only when captureReplay: true is set — so you don't pay for it unless you use it.

Configuration

| Option | Default | Description | |---|---|---| | endpoint | required | Where to POST event batches. Always relative, same origin. | | apiKey | required | Shared secret with the server. Sent as X-Observer-Key. | | environment | 'development' | Locked to 'development'; enterprise modes are out of scope. | | ignoreErrors | [] | Patterns (string or RegExp) — drop matching events before send. | | beforeSend | null | Mutate or drop events. Return null to drop. | | captureReplay | false | Enable rrweb session replay (M5). |

License

MIT © Drilon Hametaj