JSPM

  • Created
  • Published
  • Downloads 742
  • Score
    100M100P100Q11055F
  • License MIT

Rollbar wrapper for Serverless, API Gateway and Lambda.

Package Exports

  • lambda-rollbar

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lambda-rollbar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Lambda-Rollbar Wrapper

Build Status Test Coverage Greenkeeper badge NPM Downloads Semantic-Release Gardener Gitter

Rollbar wrapper for Serverless, API Gateway and Lambda.

Getting Started

To install run npm install --save lambda-rollbar

Setup

Define rollbar as

const rollbar = require('lambda-rollbar')({
  accessToken: ROLLBAR_ACCESS_TOKEN,
  environment: ENVIRONMENT,
  enabled: true,
  captureUncaught: true,
  captureUnhandledRejections: true
});

Then wrap lambda handler with

exports.handler = rollbar.wrap((event, context, callback, rb) => rb
  .warning("Some Warning...")
  .then(callback(null, { statusCode: 200, body: "{\"message\":\"Hello World.\"}" })));