@lamware/sentry
v2.0.1
Published
Lamware Middleware for tracking with Sentry
Downloads
56
Readme
This Lamware Middleware utilizes the Sentry Serverless SDK to automatically initialize and wrap your Lambda Function handler to capture errors and report them to Sentry.
Installation
This package is available via NPM:
yarn add @lamware/sentry
# or
npm install @lamware/sentry
Usage
import type { APIGatewayProxyHandlerV2 } from 'aws-lambda';
import { sentry } from '@lamware/sentry';
import { lamware } from '@lamware/core';
const { handler } = lamware<APIGatewayProxyHandlerV2<any>>()
.use(sentry({
// You can provide config directly to the SDK `init()`.
config: {
dsn: 'your-sentry-dsn-here',
},
// You can also optionally provide options to the wrapper.
wrapper: {
callbackWaitsForEmptyEventLoop: false,
},
}))
.execute(async () => {
return { statusCode: 200 };
});
export { handler };