@adhawk/error-tracking
TypeScript icon, indicating that this package has built-in type declarations

1.3.12 • Public • Published

@adhawk/error-tracking

This package sets up error tracking for projects. Behinds the curtains, it sets up and uses sentry.io.

Setup

NPM

import { init as errorTrackingInit } from "@adhawk/error-tracking";

init({
  release: "v1.0",
  environment: "production",
  sentryDsn: "...",
});

Browser

In the head tag:

<script src="https://unpkg.com/@adhawk/error-tracking"></script>

Usage

Identifying Users

This is useful for knowing which users encountered errors.

import { identify as identifyForErrorTracking } from "@adhawk/error-tracking";

identify({
  id: loggedInUser.id,
  username: loggedInUser.name,
  email: loggedInUser.email,
});

Manually Capturing Errors

This is useful for reporting exceptions which are caught.

import { captureException } from "@adhawk/error-tracking";

try {
  throw new Error("Oh no!");
} catch (e) {
  captureException(e);
}

/@adhawk/error-tracking/

    Package Sidebar

    Install

    npm i @adhawk/error-tracking

    Weekly Downloads

    86

    Version

    1.3.12

    License

    MIT

    Unpacked Size

    263 kB

    Total Files

    23

    Last publish

    Collaborators

    • stephengrable1
    • adhawk
    • janeosaur
    • stephengrable