🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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.2.0
npm
Version published
Weekly downloads
5
25%
Maintainers
4
Weekly downloads
 
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 26 Aug 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