darkspark-aws-lambda-edge-plug
v0.5.2
Published
Darkspark Plug for AWS Lambda@Edge
Downloads
19
Readme
AWS Lambda@Edge Plug for Darkspark
This library allows for the inclusion of Darkspark monitoring into a Node.js origin-response
Lambda@Edge function.
Prerequisites
- An AWS account
- A CloudFront distribution managing content delivery for the service you wish to monitor
- A Node.js Lambda@Edge function configured to trigger on
origin-response
Usage
Add the package as a dependency to your Lambda's source directory with the following command:
npm install darkspark-aws-lambda-edge-plug
Once you have installed the package, you can import into your project like so:
const { useDarkspark } = require("darkspark-aws-lambda-edge-plug");
And then integrate it into your handler function by calling useDarkspark
with the incoming event:
exports.handler = async function(event, context, callback) {
await useDarkspark(event, "<your Darkspark API key>");
// other lambda logic
...