Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 330 Bytes

09-Monitor.md

File metadata and controls

22 lines (17 loc) · 330 Bytes

install Sentry

yarn add @sentry/browser

config

edit src/index.jsx

if (process.env.NODE_ENV === "production") {
  Sentry.init({
    /* need to be replaced as an real dsn */
    dsn: process.env.SENTRY_DSN
  });

  try {
    throw new Error("Caught");
  } catch (err) {
    Sentry.captureException(err);
  }
}