open-index/open-npm huggingface dataset:
npm package: @getjerry/next-aws-cloudfront
Description: Compat layer for running next.js apps in Lambda@Edge
Author: Daniel Conde
Latest version: 1.7.10

# Next AWS CloudFront

Compat layer between next.js serverless page and CloudFront => Lambda@Edge.

Lambda@Edge event structure documentation can be found [here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html).

## Installation

`npm install next-aws-cloudfront`

## Usage

```js
const cloudFrontCompat = require("next-aws-cloudfront");
const page = require(".next/serverless/pages/somePage.js");

module.exports.render = async (event, context) => {
  const { req, res, responsePromise } = cloudFrontCompat(event.Records[0].cf);
  page.render(req, res);
  return responsePromise;
};
```

## Options

### Gzip compression

```js
const { req, res, responsePromise } = cloudFrontCompat(event.Records[0].cf, {
  enableHTTPCompression: true // false by default
});
```
npm package: @getjerry/next-aws-lambda
Description: Compat layer between next.js serverless page and AWS Lambda
Author: Daniel Conde Marin
Latest version: 2.6.14

# API Gateway Lambda Compat

Compat layer between next.js serverless page and API Gateway => Lambda Proxy Integration.

Lambda Proxy Integration event structure documentation can be found [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html).

## Installation

`npm install @sls-next/next-aws-lambda`

## Usage

```js
const compat = require("@getjerry/next-aws-lambda");
const page = require(".next/serverless/pages/somePage.js");

// using callback

module.exports.render = (event, context, callback) => {
  compat(page)(event, context, callback);
};

// using async promise

module.exports.render = async (event, context) => {
  const responsePromise = compat(page)(event, context); // don't pass the callback parameter
  return responsePromise;
};
```