Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

egg-raven

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-raven

A sentry/raven plugin to egg

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

egg-raven

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-raven --save

Usage

// {app_root}/config/plugin.js
exports.raven = {
  enable: true,
  package: 'egg-raven',
}

Configuration

// {app_root}/config/config.default.js
exports.raven = {
  dsn: 'https://your:very_secure@sentry.server/app_id',
  options: {
    // refer to https://docs.sentry.io/clients/node/config/#optional-settings for more options detail.
    autoBreadcrumbs: {
      http: true
    },
    release: '721e41770371db95eee98ca2707686226b993eda'
  }
}

see config/config.default.js for more detail.

Example

// app/controller/home.js
const { Controller } = require('egg')

class HomeController extends Controller {

  async index () {
    this.ctx.raven.captureBreadcrumb({
      message: 'Received payment confirmation',
      category: 'payment',
      data: {
        amount: 312
      }
    })
    this.ctx.runInBackground(async function backgroundJob () {
      throw new Error('will be recorded into sentry with breadcrumbs')
    })
  }

  async update() {
    throw new Error('will be recorded into sentry with detailed context')
  }

}

module.exports = HomeController

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

egg

FAQs

Package last updated on 15 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts