https://github.com/opennextjs/opennextjs-aws Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} opennextjs / opennextjs-aws Public * Notifications You must be signed in to change notification settings * Fork 127 * Star 4.2k Open-source Next.js adapter for AWS opennext.js.org License MIT license 4.2k stars 127 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 28 * Pull requests 4 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights opennextjs/opennextjs-aws main BranchesTags [ ] Go to file Code Folders and files Last commit Last Name Name message commit date Latest commit History 534 Commits .changeset .changeset .github .github .vscode .vscode docs docs examples examples packages packages .git-blame-ignore-revs .git-blame-ignore-revs .gitignore .gitignore .npmrc .npmrc CHANGELOG.md CHANGELOG.md CNAME CNAME LICENSE LICENSE README.md README.md biome.jsonc biome.jsonc package.json package.json pnpm-lock.yaml pnpm-lock.yaml pnpm-workspace.yaml pnpm-workspace.yaml turbo.json turbo.json View all files Repository files navigation * README * MIT license OpenNext Discord npm --------------------------------------------------------------------- Docs Description OpenNext takes the Next.js build output and converts it into packages that can be deployed across a variety of environments. Natively OpenNext has support for AWS Lambda, and classic Node.js Server. Features OpenNext aims to support all Next.js 14 features. Some features are work in progress. If you are running into any problems make sure to check the docs first before you open a new issue or visit our Discord to let us know! * [*] App & Pages Router * [*] API routes * [*] Dynamic routes * [*] Static site generation (SSG) * [*] Server-side rendering (SSR) * [*] Incremental static regeneration (ISR) * [*] Middleware * [*] Server actions * [*] Image optimization * [*] NextAuth.js * [*] Running at edge * [*] Almost no coldstart (*) Who is using OpenNext? Gymshark UK, Udacity, TUDN, NHS England Configuration Configuration file For personalisation you need to create a file open-next.config.ts at the same place as your next.config.js, and export a default object that satisfies the OpenNextConfig interface. It is possible to not have an open-next.config.ts file, the default configuration will then be applied automatically. Debug mode OpenNext can be executed in debug mode by setting the environment variable OPEN_NEXT_DEBUG=true before your build. This will output A LOT of additional logs to the console. This also disable minifying in esbuild, and add source maps to the output. This can result in code that might be up to 2-3X larger than the production build. Do not enable this in production. You can read more about the configuration in the docs Preleases Besides the standard npm releases we also automatically publish prerelease packages on branch pushes (using pkg.pr.new): * https://pkg.pr.new/@opennextjs/aws@main: Updated with every push to the main branch, this prerelease contains the most up to date yet (reasonably) stable version of the package. * https://pkg.pr.new/@opennextjs/aws@experimental Updated with every push to the experimental branch, this prerelease contains the latest experimental version of the package (containing features that we want to test/experiment on before committing to). Which you can simply install directly with your package manager of choice, for example: npm i https://pkg.pr.new/@opennextjs/aws@main Contribute To run OpenNext locally: 1. Clone this repository. 2. Build open-next: cd packages/open-next pnpm build 3. Run open-next in watch mode: pnpm dev 4. Now, you can make changes in open-next and build your Next.js app to test the changes. cd path/to/my/nextjs/app path/to/open-next/packages/open-next/dist/index.js build Coldstart OpenNext provide you with a warmer function that can be used to reduce cold start. On Lambda, there are multiple scenarios where a lambda will trigger a cold start even if you have some warmed instance. For example if you have more requests than warm instances you'll get a cold start. Also NextJs lazy load the routes, so even if you hit a warm instance, this specific route might not have been loaded yet. Acknowledgements We are grateful for the projects that inspired OpenNext and the amazing tools and libraries developed by the community: * nextjs-lambda by Jan for serving as inspiration for packaging Next.js's standalone output to Lambda. * CDK NextJS by JetBridge for its contribution to the deployment architecture of a Next.js application on AWS. * serverless-http by Doug Moscrop for developing an excellent library for transforming AWS Lambda events and responses. * serverless-nextjs by Serverless Framework for paving the way for serverless Next.js applications on AWS. Special shoutout to @khuezy and @conico974 for their outstanding contributions to the project. --------------------------------------------------------------------- Maintained by SST. Join our community: Discord | YouTube | Twitter About Open-source Next.js adapter for AWS opennext.js.org Topics aws nextjs sst Resources Readme License MIT license Activity Custom properties Stars 4.2k stars Watchers 21 watching Forks 127 forks Report repository Releases 77 v3.2.1 Latest Oct 31, 2024 + 76 releases Contributors 63 * @fwang * @conico974 * @github-actions[bot] * @khuezy * @jayair * @vicb * @sommeeeer * @socsieng * @dario-piotrowicz * @sladg * @vladiulianbogdan * @dkershner6 * @thdxr * @JanStevens + 49 contributors Languages * TypeScript 99.2% * Other 0.8% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.