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

@artim-industries/stacktrace-sdk-react

v1.0.6

Published

React SDK for Artim Stacktrace.

Readme

@artim-industries/stacktrace-sdk-react

React SDK for Artim Stacktrace.

This package provides a lightweight React integration for capturing exceptions, messages, and user context in your React application and sending them to the Artim Stacktrace backend.

Installation

npm install @artim-industries/stacktrace-sdk-react

Usage

Basic Setup

import { ArtimStacktrace } from "@artim-industries/stacktrace-sdk-react";

ArtimStacktrace.init({
  apiKey: "your-api-key",
  environment: "production",
  release: "1.0.0",
});

Capture errors manually

try {
  // some code that throws
} catch (error) {
  ArtimStacktrace.captureException(error as Error);
}

Capture messages

ArtimStacktrace.captureMessage("A recoverable warning occurred", "warning");

Set user context

ArtimStacktrace.setUser({
  id: "user-123",
  email: "[email protected]",
  username: "jane.doe",
});

Identify user

ArtimStacktrace.identify("user-123");

React integration

For React apps, use the exported React helpers.

Error boundary

// providers/ErrorProvider.tsx

"use client";

import { useRef } from "react";

import { ArtimErrorBoundary } from "@artim-industries/stacktrace-sdk-react/react";
import { ArtimStacktrace } from "@artim-industries/stacktrace-sdk-react";

export default function ErrorProvider({
  children,
}: {
  children: React.ReactNode;
}) {
  const initialized = useRef(false);

  if (typeof window !== "undefined" && !initialized.current) {
    ArtimStacktrace.init({
      apiKey: "your_api_key",
      environment: "production",
      release: "1.0.0",
    });
    initialized.current = true;
  }

  return (
    <ArtimErrorBoundary errorComponent={<h1>Custom Error Component</h1>}>
      {children}
    </ArtimErrorBoundary>
  );
}
//layout.tsx

import ErrorProvider from "@/providers/ErrorProvider";

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="de">
      <body>
        <ErrorProvider>{children}</ErrorProvider>
      </body>
    </html>
  );
}

Hook for user context

import { useArtimUser } from "@artim-industries/stacktrace-sdk-react/react";

function App({ user }) {
  useArtimUser(user);

  return <YourApp />;
}

API

ArtimStacktrace.init(config)

Initializes the SDK with required configuration.

  • apiKey (string): API key for authenticating requests.
  • environment (string): Deployment environment.
  • release (string): Release version.

ArtimStacktrace.captureException(error, level?)

Captures an exception and sends it to the backend.

  • error (Error): Error object.
  • level (error | warning | fatal, default error): Event severity.

ArtimStacktrace.captureMessage(message, level?)

Captures a custom message.

  • message (string): Text message.
  • level (error | warning | fatal, default warning): Event severity.

ArtimStacktrace.setUser(user)

Sets the current user context for future events.

ArtimStacktrace.identify(userId)

Sets the current user identity.

Build

npm run build

Package exports

  • @artim-industries/stacktrace-sdk-react — core SDK
  • @artim-industries/stacktrace-sdk-react/react — React helpers

License

MIT

Important

Does not work if there's already a error boundary (like in Next.js a error.tsx in root etc.)