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-native

v1.0.7

Published

React Native SDK for Artim Stacktrace.

Downloads

892

Readme

@artim-industries/stacktrace-sdk-react-native

React Native SDK for Artim Stacktrace.

Installation

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

(npm install react-native-svg)

Usage

import { ArtimStacktrace } from '@artim-industries/stacktrace-sdk-react-native'

ArtimStacktrace.init({
  apiKey: 'your-api-key',
  projectId: 'your-project-id',
  environment: 'production',
  release: '1.0.0',
})

ArtimStacktrace.captureMessage('Hello from React Native')

API

  • init(config)
  • captureException(error, level)
  • captureNativeException(payload, level)
  • captureMessage(message, level)
  • setUser(user)
  • identify(fn)
  • ArtimErrorBoundary

Native error tracking

Für native Fehler brauchst du eine zusätzliche native Brücke in iOS/Android:

  • init(config) startet den JS-ErrorHandler und installiert automatisch den nativen Handler, sofern das native Modul vorhanden ist
  • captureNativeException(payload) kann von einem nativen Modul aufgerufen werden, wenn ein Crash oder eine native Ausnahme auftritt

Die Payload sollte mindestens enthalten:

{
  message: string
  stacktrace: string[]
  level: 'error' | 'warning' | 'fatal'
  native: true
  exceptionType?: string
  osName?: string
  osVersion?: string
  threadName?: string
  extra?: Record<string, any>
}

ArtimStacktrace schickt diese Daten dann wie normale Fehler an den Backend-Endpunkt.

Native Auto-Capture

Die Bibliothek liefert native Auto-Capture-Unterstützung für iOS und Android. Dabei werden native Crash-Handler installiert und native Ausnahmen automatisch an den Artim Stacktrace-Endpunkt gesendet.

JS Initialisierung

ArtimStacktrace.init({ enableNativeErrors: true }) startet den JS-Error-Handler und ruft zusätzlich das native Modul ArtimStacktraceNative.installNativeHandler(config) auf.

Das ist ausreichend für native Errors, die nach dem Laden der React Native-Engine passieren.

iOS (früher Install-Pfad)

Für echte Startup-Crash-Abdeckung unter iOS sollte der native Handler so früh wie möglich installiert werden, also im App-Startcode, bevor die React Native-UI geladen wird.

  1. Füge den nativen Header zur Bridging Header-Datei hinzu:
#import <ArtimStacktraceSdkReactNative/ArtimStacktraceNative.h>
  1. Installiere den Handler in AppDelegate.swift vor factory.startReactNative(...):
private func installArtimStacktraceNativeHandler() {
  let config: [String: Any] = [
    "apiKey": "your-api-key",
    "endpoint": "https://stacktrace-backend.artim-industries.com/api/events",
    "environment": "production",
    "release": "1.0.0",
    "platform": "react-native",
  ]

  let module = ArtimStacktraceNative()
  module.installNativeHandler(config)
}
  1. Rufe installArtimStacktraceNativeHandler() in application(_:didFinishLaunchingWithOptions:) auf.

Das sorgt dafür, dass native Abstürze wie fatalError oder frühzeitige Objective-C-Ausnahmen ebenfalls erfasst werden.

Android

Unter Android wird der native Handler durch das native Modul installiert, wenn ArtimStacktrace.init(...) ausgeführt wird und das native Modul geladen wurde.

Das ist häufig ausreichend für native Fehler nach dem Start der React Native-Engine.

Für einen noch früheren Schutz, z. B. vor JS-Bundle-Initialisierung, solltest du den Handler direkt in MainApplication.java oder in der Android-Application.onCreate()-Methode installieren, bevor die React Native-Instanz erstellt wird.

In diesem Fall muss der Handler ähnlich wie im SDK konfiguriert werden:

  • Thread.setDefaultUncaughtExceptionHandler(...)
  • Erstelle und sende das Payload an denselben Backend-Endpunkt

Manuelle native Übergabe

Falls du zusätzliche native Fehler manuell erfassen möchtest, kannst du das native Modul ebenfalls direkt verwenden:

import { ArtimStacktrace } from '@artim-industries/stacktrace-sdk-react-native'

ArtimStacktrace.captureNativeException({
  message: 'Native error from Android/iOS',
  stacktrace: ['line 1', 'line 2'],
  level: 'fatal',
  native: true,
  exceptionType: 'NullPointerException',
  osName: 'Android',
  osVersion: '14',
  threadName: 'main',
})

Error boundary

// providers/ErrorProvider.tsx

"use client";

import { useRef } from "react";
import { ArtimErrorBoundary } from "@artim-industries/stacktrace-sdk-react-native";
import { ArtimStacktrace } from "@artim-industries/stacktrace-sdk-react-native";
import { router } from "expo-router";
import { Linking } from "react-native";
import AsyncStorage from "@react-native-async-storage/async-storage";

export default function ErrorProvider({
  children,
  pathname,
}: {
  children: React.ReactNode;
  pathname?: string;
}) {
  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;
  }

  const onContactSupport = () => {
    // for example

    Linking.openURL("https://support.artim-industries.com");
  };

  const onClearCache = async () => {
    // for example

    await AsyncStorage.clear();
    router.reload();
  };

  const onSignOut = async () => {
    // for example

    await AsyncStorage.clear();
    router.push("/splash");
  };

  return (
    <ArtimErrorBoundary
      pathname={pathname}
      onContactSupport={onContactSupport}
      onClearCache={onClearCache}
      onSignOut={onSignOut}
      errorComponent={<h1> Hello from Custom Error Component </h1>}
    >
      {children}
    </ArtimErrorBoundary>
  );
}

ArtimErrorBoundary fängt Rendering- und Lifecycle-Fehler in React Native-Komponenten ab und meldet sie an Artim Stacktrace. Du kannst per errorComponent ein eigenes Error-Page-Design übergeben.