pan-opt

panopticon-js Panopticon SDK for javascript


Keywords
SDK, Panopticon, pan-opt, javascript, error, debugging, logging
License
ISC
Install
npm install pan-opt@2.1.1

Documentation

Panopticon JavaScript SDK

Usage

install SDK from the CLI

npm install pan-opt

initialize Panopticon at the entry point of your app

import Panopticon from "pan-opt";


Panopticon.init(dsn) // dsn: your dsn issued from panopticon.gq

To set context information or send manual errors, use the exported functions of pan-opt.

import Panopticon from "pan-opt";

// Set user information, as well as tags and further extras
Panopticon.setTag('custom', 'Tag');
Panopticon.setTag('foo', 'bar');
Panopticon.setUser('Warden');

// Capture exceptions, send manual errors
try {
  throw new Error("Maybe I'll be caught by try-catch");
} catch (err) {
  Panopticon.send(err);
}