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

@serverless/sdk-beta

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serverless/sdk-beta

## Install

  • 0.4.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

sdk

Install

npm i --save @serverless/sdk-beta

How to use

Wrap your function with the SDK's trackHandler:

const sdk = require('@serverless/sdk-beta')('testAPIKey');

// Your function handler
module.exports.hello = sdk.trackHandler((event, context, cb) => {
  cb(null, {
    message: 'Go Serverless v1.0! Your function executed successfully!', event
  });
});

API

trackHandler(handler, tags)

Track handler function invocations.

Arguments:

  • handler - required - function to track by SDK.
  • tags - optional object with custom tags e.g. {'owner': 'teamA'}. Each key/value pair is treated as separate tag. region and runtime tags are added to each invocation.
Tracking errors

Errors thrown from within handler function are automatically tracked.

module.exports.hello = sdk.trackHandler((event, context, cb) => {
  throw new Error('Whoops!');
});

FAQs

Package last updated on 15 Sep 2016

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