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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@errors-tracer/react

v1.0.6

Published

A React Library For Handling All Errors And Report In A Registry Website

Downloads

7

Readme

NPM JavaScript Style Guide

React Error Boundary

About

A library for logging errors remotely in an error logger platform. To get started you need to create a developer account in errors tracer platform and start monitoring your production errors.

Installation

npm install --save @errors-tracer/react

or

yarn add @errors-tracer/react

Usage

You can use the error boundary for each development and production environments to separately monitor your apps.

To get started you need to create an application under your organization and activate it, then go to credentials tab and copy appKey and orgKey and make sure which environment you are using.

Development/Production Credentials

Each application has a development and production credentials, the developer might need to setup an env variables in the project and then specify each credentials for the proper env.

Credentials Object

The credentials object includes two values and you can get them from the platform.

{
	orgKey:  'YOUR_ORGANIZATION_KEY',
	appKey:  'YOUR_APPLICATION_KEY'
}

It's optional to pass the credentials object depends on which you want to use the library as an error boundary or a remote error logger.

Additional Data

You can send an additional data object as well, this option will provide you with a better debugging capability and you might get benefits of it for example you can send the username or email to know exactly the user who had the issue.

You can pass anything as an object such as email, phone number, user's first and last names.

const additionalData = {
  email: '[email protected]'
}

Example

Normal React Apps:

import React from 'react'
import ReactDOM from 'react-dom'
import { ErrorBoundary } from '@errors-tracer/react'

const credentials = {
  orgKey: YOUR_ORGANIZATION_KEY,
  appKey: YOUR_APPLICATION_KEY
}

// you can pass the additionalData prop to the ErrorBoundary

ReactDOM.render(
  <ErrorBoundary additionalData={/*pass your object*/} credentials={credentials} fallback={<FallbackComponent />}>
    <App />
  </ErrorBoundary>,
  document.getElementById('root')
)

For Next.js Apps:

In your _app.tsx file import the ErrorBoundary Component from @errors-tracer/react

import type { AppProps } from 'next/app'
import { ErrorBoundary } from '@errors-tracer/react'

export default function App({ Component, pageProps }: AppProps) {
  const credentials = {
    orgKey: YOUR_ORGANIZATION_KEY,
    appKey: YOUR_APPLICATION_KEY
  }

  return (
    <ErrorBoundary credentials={credentials} fallback={<FallbackComponent />}>
      <Component {...pageProps} />
    </ErrorBoundary>
  )
}

License

MIT © Elsiddig Ahmed