
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Sentry Plugin for Eggjs
This module is to helper developers setup sentry with least work.
Install egg-sentry as an npm module and save it to your package.json file as a development dependency:
npm install --save egg-sentry
Add sentry configuration:
// config/config.default.js
exports.sentry = {
dsn: 'https://819e74a6e948468b9740680cfa87986b:38aaa0c0d51e463597493c250ff11f83@sentry.io/246025',
};
Replace the dsn with your own one, get details at Sentry.
From now on, expections are able to submit to sentry. What if we wanna more custom information, such as logined user?
To get a rich context, implemet Egg Service in app/service/sentry.js file and there are four member properties or methods are supported.
// app/service/sentry.js
'use strict';
const Service = require('egg').Service;
class SentryService extends Service {
/**
* filter errors need to be submitted to sentry
*
* @param {any} err error
* @return {boolean} true for submit, default true
* @memberof SentryService
*/
judgeError(err) {
// ignore HTTP Error
return !(err.status && err.status > 500);
}
// user information
get user() {
return this.ctx.session.user;
}
get extra() {
return {
ip: this.ctx.ip,
payload: this.ctx.request.body,
};
}
get tags() {
return {
url: this.ctx.request.url,
};
}
}
module.exports = SentryService;
These infomation would be automaticlly injected into error context.
Replace the dsn in test/fixtures/apps/sentry-test/config/config.unittest.js and then run npm start to see what would happend.
FAQs
Sentry Plugin for Eggjs
The npm package egg-sentry receives a total of 16 weekly downloads. As such, egg-sentry popularity was classified as not popular.
We found that egg-sentry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.