0.0.8 • Published 4 years ago

sentry-handler-node v0.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

sentry-handler-node

sentry-handler-node is a lightweight wrapper for your Node applications that will automatically send any unhandled errors to Sentry.

Setup

Setting up sentry-handler-node is super easy.

  1. Install sentry-handler-node.

    npm i sentry-handler-node
  2. Wrap the entry point of your Node application.

    const { withSentry } = require('sentry-handler-node');
    
    // everything in this object gets sent to sentry.init()
    const config = { dsn: 'https://your-sentry-dsn-url@sentry.io/xxxxxxx' };
    
    module.exports = withSentry(myAsyncFunction, config);
  3. (Optional) Set NODE_ENV to 'development' when not in production.

    Setting NODE_ENV to 'development' will just console.error your errors, it won't send anything to Sentry. There are a bunch of ways to set NODE_ENV, it just depends on how your project is setup.

Setting NODE_ENV

lambda-local: add this argument to your lambda-local command:

-E '{\"NODE_ENV\": \"development\"}'
0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago