This package is a wrapper around @sentry/node, with added functionality related to various Serverless solutions. All
methods available in @sentry/node can be imported from @sentry/serverless.
Currently supported environment:
AWS Lambda
To use this SDK, call Sentry.init(options) at the very beginning of your JavaScript file.
import * as Sentry from '@sentry/serverless';
Sentry.init({
dsn: '__DSN__',
// ...
});
// async (recommended)
exports.handler = Sentry.AWSLambda.wrapHandler(async (event, context) => {
throw new Error('oh, hello there!');
});
// sync
exports.handler = Sentry.AWSLambda.wrapHandler((event, context, callback) => {
throw new Error('oh, hello there!');
});