Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-rollbar

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-rollbar

Rollbar wrapper for Serverless, API Gateway and Lambda.

  • 1.8.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Lambda-Rollbar Wrapper

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

Rollbar wrapper for Serverless, API Gateway and Lambda.

Getting Started

To install run npm install --save lambda-rollbar

Usage

Define rollbar and wrap handlers with

const rollbar = require('lambda-rollbar')({
  accessToken: "YOUR_ROLLBAR_ACCESS_TOKEN",
  environment: "YOUR_ENVIRONMENT",
  enabled: true,
  template: 'aws-sls-lambda-proxy'
});

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

Available log levels are debug, info, warning, error and critical.

You can set an environment on a per call bases using rb.warning("YOUR_MESSAGE", "YOUR_ENVIRONMENT").

Verbose Option

Use the boolean verbose option to log messages to console. This option also get's passed through into rollbar.

Request Templates

Lambda functions are called in different request context. Using the template option you can define which request context should be assumed. Currently supported are:

  • aws-sls-lambda-proxy (default) - Default event template for API Gateway using the Serverless Framework
  • aws-cloud-watch - For CloudWatch logs events

Contributions / What is next

  • Templates - Adding more templates is easy and PRs are welcome! Sample events can be found here. Make sure you only use fields listed under request, i.e. url, method, body.

Keywords

FAQs

Package last updated on 17 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc