# @rayova/cdk-serverless-nextjs

> Deploy Serverless Next.js on Lambda @ Edge with the AWS CDK

Latest version **0.1.42** (published 2022-03-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @rayova/cdk-serverless-nextjs
pnpm add @rayova/cdk-serverless-nextjs
yarn add @rayova/cdk-serverless-nextjs
bun add @rayova/cdk-serverless-nextjs
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.42 |
| Published | 2022-03-18 |
| First published | 2021-09-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 160.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Josh Kellendonk |
| Maintainers | misterjoshua, ekellendonk |
| Keywords | cdk, cloudfront, isr, lambda, next, nextjs, react, serverless, ssr |

## Links

- npm: https://www.npmjs.com/package/@rayova/cdk-serverless-nextjs
- Repository: https://github.com/rayova/cdk-serverless-nextjs
- Homepage: https://github.com/rayova/cdk-serverless-nextjs#readme
- Issues: https://github.com/rayova/cdk-serverless-nextjs/issues
- npm.io page: https://npm.io/package/@rayova/cdk-serverless-nextjs

## Dependencies (4)

- [execa](https://npm.io/package/execa.md) ^5.1.1
- [yargs](https://npm.io/package/yargs.md) ^17.3.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.1
- [@sls-next/lambda-at-edge](https://npm.io/package/@sls-next/lambda-at-edge.md) ^3.6.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.42 (latest) — 2022-03-18
- 0.1.41 — 2022-03-17
- 0.1.40 — 2022-03-16
- 0.1.39 — 2022-03-15
- 0.1.38 — 2022-03-14
- 0.1.37 — 2022-03-13
- 0.1.36 — 2022-03-12
- 0.1.35 — 2022-03-11
- 0.1.34 — 2022-03-10
- 0.1.33 — 2022-03-09
- 0.1.32 — 2022-03-08
- 0.1.31 — 2022-03-07
- 0.1.30 — 2022-03-05
- 0.1.29 — 2022-03-04
- 0.1.28 — 2022-03-03
- … 89 more at https://npm.io/package/@rayova/cdk-serverless-nextjs/versions

## README

![Rayova A Fintech Corporation][logo]

# CDK Serverless Next.js

This project provides an AWS CDK construct to Deploy Serverless Next.js to
Lambda@Edge. We designed the construct following these principles:

* Sensible defaults
* Feature parity with Next.js
* Fast deployments
* Build the AWS Lambda deployment package for you
* Provide `BehaviorOptions` for you to add to your CloudFront Distribution

## Supported Next.js features

This construct library aims for feature parity with Next.js. Through
[@sls-next/lambda-at-edge][@sls-next/lambda-at-edge], this CDK construct
supports:

* Next.js 10/11
* Static pages
* Server-side props
* Static props and static prop fallback
* Incremental static regeneration
* Image optimization
* API routes

## Example Usage

<!-- <macro exec="lit-snip ./test/integ.main.lit.ts"> -->
```ts
// Create a ServerlessNextjs construct in your stack to get started.
// Your stack MUST be in us-east-1 as that's the only region in which AWS
// supports deploying edge lambdas.
const serverlessNextjs = new ServerlessNextjs(scope, 'NextJs', {
  // Then produce and add a Next.js artifact to ServerlessNextjs by
  // building it from your project directory.
  nextjsArtifact: NextjsArtifact.fromBuild({
    // Provide your Next.js project directory.
    nextjsDirectory: pathToYourProjectDirectory,

    // Provide the commands you need NextjsArtifact to run to build the
    // `.next` directory.
    buildCommand: ['yarn', 'next', 'build'],
  }),
});

// Create CloudFront distribution
const dist = new cloudfront.Distribution(scope, 'Distribution', {
  // And configure it with serverless Next.js as Lambda @ Edge
  ...serverlessNextjs.cloudFrontConfig,

  // Add anything else you need on your CloudFront distribution here, like
  // certificates, cnames, price classes, logging, etc.
});
```
<!-- </macro> -->

[logo]: images/rayova-fintech-corp.png
[@sls-next/lambda-at-edge]: https://www.npmjs.com/package/@sls-next/lambda-at-edge

---
_Source: https://npm.io/package/@rayova/cdk-serverless-nextjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
