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

@arguslog/sdk-react

v1.1.3

Published

Arguslog React 19 SDK — ErrorBoundary, hooks, RR/RQ adapters

Readme

@arguslog/sdk-react

npm version license

React 19 bindings for Arguslog error tracking. Adds an <ArguslogErrorBoundary> that captures render-time errors plus a useArguslog() hook for imperative reporting from inside components.

Re-exports the entire @arguslog/sdk-browser public API, so you don't need both packages in your imports.

Peer dependency: React ≥ 19.

Install

pnpm add @arguslog/sdk-react
# or
npm install @arguslog/sdk-react
# or
yarn add @arguslog/sdk-react

@arguslog/sdk-browser is pulled in automatically as a regular dependency — no separate install required.

Quick start

Initialize once at app boot, then wrap your component tree in <ArguslogErrorBoundary>:

import { init, ArguslogErrorBoundary } from '@arguslog/sdk-react';
import { createRoot } from 'react-dom/client';

init({
  dsn: 'arguslog://<publicKey>@<ingestHost>/api/<projectId>',
  environment: import.meta.env.MODE,
  release: import.meta.env.VITE_RELEASE,
  integrations: ['globalHandlers', 'autoBreadcrumbs'],
});

createRoot(document.getElementById('root')!).render(
  <ArguslogErrorBoundary fallback={<div role="alert">Something went wrong.</div>}>
    <App />
  </ArguslogErrorBoundary>,
);

The boundary catches anything React throws during render / lifecycle / effect-cleanup, ships it to Arguslog with boundary: 'react' tag, and renders the fallback. Imperative async errors (event handlers, fetch callbacks) need explicit captureException because React boundaries don't see those by design.

API

Everything the browser SDK exports is re-exported from this package — see the browser SDK README for init, captureException, captureMessage, setUser, setTag, setContext, addBreadcrumb, flush, and the ArguslogOptions shape.

<ArguslogErrorBoundary>

<ArguslogErrorBoundary fallback={…} onError={(error, info) => …}>
  <App />
</ArguslogErrorBoundary>

| Prop | Type | Notes | | ---------- | ---------------------------------------------- | ---------------------------------------------------------------------- | | fallback | ReactNode \| ({ error, reset }) => ReactNode | Render-prop form gets a reset() to retry without a hard navigation. | | onError | (error: Error, info: ErrorInfo) => void | Side-channel — fires AFTER the SDK reports. Useful for custom logging. | | children | ReactNode | Subtree to protect. |

useArguslog()

Stable bag of imperative helpers — same identity across renders, no useEffect needed.

import { useArguslog } from '@arguslog/sdk-react';

function CheckoutButton() {
  const arguslog = useArguslog();

  return (
    <button
      onClick={async () => {
        try {
          await pay();
        } catch (err) {
          arguslog.captureException(err, { tags: { feature: 'checkout' } });
        }
      }}
    >
      Pay
    </button>
  );
}

The returned object exposes:

  • captureException(error, hint?)
  • captureMessage(message, level?)
  • addBreadcrumb(crumb)
  • setUser(user | undefined)
  • setTag(key, value)
  • setContext(name, ctx)
  • isInitialized() — boolean check before calling other methods (handy in SSR).

Patterns

Reset after a recoverable error

<ArguslogErrorBoundary
  fallback={({ error, reset }) => (
    <div role="alert">
      <p>{error.message}</p>
      <button onClick={reset}>Try again</button>
    </div>
  )}
>
  <App />
</ArguslogErrorBoundary>

Per-route boundaries

Wrap inside React Router routes so a render error in one screen doesn't blank the entire shell:

<Route
  path="/orders/:id"
  element={
    <ArguslogErrorBoundary fallback={<OrderErrorFallback />}>
      <OrderDetail />
    </ArguslogErrorBoundary>
  }
/>

Tag the user on login

const { setUser } = useArguslog();
useEffect(() => {
  if (auth.user) setUser({ id: auth.user.id, email: auth.user.email });
  return () => setUser(undefined);
}, [auth.user]);

SSR / Next.js

init reads window only when global handlers integration is enabled. Importing the package in a server component or getServerSideProps is safe. For server-side capture you typically want a separate Node SDK — coming in a future release.

License

MIT — see LICENSE.