# Next.js — card for AI agents

React framework for production with server-side rendering and static generation.

Category: Web frameworks · npm package `next` · latest version 16.4.3 (checked 2026-11-01)
Install: `npm install next`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Next.js
- Read the docs for the Next.js version in the project's `package.json`, not the latest. Versioned copies live at `/docs/{version}/...`.
- Check whether the project uses the App Router (`/docs/app/`) or the Pages Router (`/docs/pages/`), and answer only from that section.
- Prefer nextjs.org pages over recalled knowledge for `next.config.js` options, file conventions, `next/*` APIs and CLI flags. The maintainers say older answers are frequently wrong.
- When an error links to `nextjs.org/docs/messages/...`, open that page. It explains the cause and the fix.
- Fetch docs as markdown with `Accept: text/markdown` or by appending `.md`, but cite the canonical URL, never the `.md` one.
- For upgrades, use `/docs/app/guides/upgrading` for migration guides and `/blog` for what changed in a release.
- The docs site has no REST API and no API keys. Do not ask the user to sign up for anything to read it.

## Agent Skills for it
- Official: vercel/next.js (30 skills): `npx skills add vercel/next.js`

## Docs written for agents
- [llms.txt (index of the docs)](https://nextjs.org/llms.txt)

## What it is
- Next.js wraps React components with routing, data fetching, rendering and build tooling. Routes come from the file system, and the site says this covers nested layouts and more advanced routing patterns. A component can be made async and await its data. The site says Next.js supports both server and client data fetching.
- Server code sits in the same project as the UI. Server Actions run server code when the client calls a function. Route Handlers serve API endpoints for things like auth or webhooks. A Proxy layer lets code define routing and access rules on incoming requests. Rendering and caching are chosen per page, including Incremental Static Regeneration (ISR). For tooling, the site lists Turbopack, which it describes as "written in Rust , and built into Next.js", and the Speedy Web Compiler, a Rust-based platform used for compilation and minification.
- The docs are split between the App Router and the older Pages Router. Versioned docs for 15 and 14 sit alongside the current 16.x docs. The framework is MIT-licensed and installed from npm.

## Caveats
- Remembered answers go stale: The maintainers' guide for language models says older answers about Next.js are frequently wrong. It tells readers to use the current pages instead.
- Two routers, two sets of docs: Features belong to either the App Router or the Pages Router, and the docs are split between them. Advice from the wrong section will not fit the project.
- Server rendering can raise the bill: The Unplatform article lists careless use of server-side rendering as a source of unexpected service costs.
- Core Web Vitals are easy to break: The same article names runtime performance as a challenge: it says the smallest code changes can drop performance and other Core Web Vitals.
- Starter folders get hard to follow as code grows: The author says the `create-next-app` folder layout is fine for smaller projects. As their project grew, it became harder to tell which components were used where.

## Numbers (AgentGid data)
- Gid Score: 94.3 (#3 of all tools, 2 of 76 in its category)
- Used in 1,118 public projects set up for AI coding agents (17.9%)
- Downloads last week: 98,003,359 (as of 2026-11-24), +42.4% over 4 weeks
- GitHub stars: 143,621 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
React 98.7%, Lucide React 73.5%, Tailwind CSS 92.9%, clsx 68.2%, Tailwind Merge 66.2%, Class Variance Authority 59.1%

## Checked alternatives (same job)
- Astro: https://agentgid.com/tools/astro/agent.md
- Nuxt: https://agentgid.com/tools/nuxt/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/next/
- Homepage: https://nextjs.org
- Repository: https://github.com/vercel/next.js
- Source: https://github.com/vercel/next.js
- Source: https://github.com/vercel/next.js/releases
- Source: https://nextjs.org
- Source: https://nextjs.org/llms.txt


## Next.js: build full websites and web apps with React

Next.js is a free framework for building websites and web apps with React. Folders in your project become the pages of your site, and the same project can also hold the server code behind them, such as form handlers. You run it on a Node.js server or a host that supports it, or export a plain static site.

### Where to use it
- A page for every blog post: Your blog, docs or shop has one page design; Next.js fills it for each address like /blog/my-first-post from the name in the link.
- Form handlers next to the pages: A contact form or a payment provider needs an address to send data to; you write that small server handler in the same project.
- Host the site as plain files: A landing page or docs site gets built into plain HTML files that any simple web host can serve, with no server running.
- Good link previews and search titles: Each page gets its own title, description and share picture, so links look right in chats and search results.
- Check sign-in before a page opens: Send visitors who are not signed in to the login page, or log each visit, before the page is built.
- Small admin panel for a team: One project holds the screens, the forms and the code that saves changes to your database, so a small team tool ships as one app. (idea, not from the official pages)

### How to start
- Make a new project with the official starter (TypeScript, Tailwind CSS, ESLint and the App Router are on by default), then start the dev server.

```
npx create-next-app@latest my-app --yes
cd my-app
npm run dev
```

- Or add it to an existing folder by hand and put these scripts into package.json.

```
npm i next@latest react@latest react-dom@latest
# package.json scripts:
# "dev": "next dev", "build": "next build", "start": "next start"
```

- Create app/layout.tsx (required, holds the html and body tags) and app/page.tsx; both show at the root address /.

```
// app/page.tsx
export default function Page() {
  return <h1>Hello, Next.js!</h1>
}
```


### License
Free to use in any project, including paid and closed-source ones, under the MIT license. Keep the copyright and license notice when you ship its files.

### Good to know
- It needs Node.js 20.9 or newer on your computer and on the server, and runs on macOS, Windows and Linux.
- Exported as plain files, the site loses everything that needs a live server, such as cookies, redirects and sign-in checks.
- Settings whose names start with NEXT_PUBLIC_ are copied into the code every visitor downloads, so never put secret keys there.
- Anyone can call your server save functions directly, not only through your forms, so each one must check who is asking.
- Only the newest major version gets new features; the one before it gets fixes for a while, older ones get none.

Checked 2026-11-11 against: https://nextjs.org/docs, https://nextjs.org/docs/app/getting-started/installation, https://nextjs.org/docs/app/getting-started/layouts-and-pages, https://nextjs.org/docs/app/getting-started/deploying, https://nextjs.org/docs/app/getting-started/route-handlers, https://nextjs.org/docs/app/getting-started/mutating-data, https://nextjs.org/docs/app/getting-started/server-and-client-components, https://nextjs.org/docs/app/getting-started/metadata-and-og-images, https://nextjs.org/docs/app/api-reference/file-conventions/dynamic-routes, https://nextjs.org/docs/app/api-reference/file-conventions/route-groups, https://nextjs.org/docs/app/api-reference/file-conventions/route, https://nextjs.org/docs/app/api-reference/file-conventions/proxy, https://nextjs.org/docs/app/guides/static-exports, https://nextjs.org/docs/app/guides/environment-variables, https://nextjs.org/docs/app/guides/upgrading/version-15, https://nextjs.org/docs/app/guides/upgrading/version-16, https://nextjs.org/blog/next-16, https://nextjs.org/blog/CVE-2025-66478, https://nextjs.org/support-policy, https://nextjs.org/telemetry, https://github.com/vercel/next.js/blob/canary/license.md, https://github.com/vercel/next.js/blob/canary/packages/next/README.md, https://registry.npmjs.org/next, https://registry.npmjs.org/next/16.4.6

### Mistakes to avoid
- Don't: A new middleware.ts with export function middleware(request) in a Next.js 16 app → Do: Name the file proxy.ts and the function proxy; keep middleware.ts only if the code must run on the edge runtime (Next.js 16 deprecated the middleware file name and named export; proxy always runs on Node.js.)
- Don't: const { slug } = params, or cookies().get('x') without await → Do: const { slug } = await params; const store = await cookies() (Version 15 still allowed synchronous access with a warning; version 16 removed it for params, searchParams, cookies, headers and draftMode.)
- Don't: Building or running Next.js 16 on Node.js 18 → Do: Use Node.js 20.9 or newer (engines in package.json says >=20.9.0) (Version 16 raised the minimum Node.js version.)
- Don't: Mixing Pages Router code (pages/, getServerSideProps) into an app/ folder project from an old tutorial → Do: Check which router the project uses and read that router's docs; new code goes in app/ with Server Components (Next.js has two routers with separate docs and different React version handling.)
- Don't: Keeping an App Router app on 15.x or 16.0 releases older than the patched ones from December 2025 → Do: Use the latest release of your line (16.0.7 or newer on 16.x; we checked 16.4.6) (CVE-2025-66478 in the React Server Components protocol allowed remote code execution on unpatched App Router apps.)

### Questions
- Can I use it in a paid, closed-source product? Yes. It is MIT licensed; keep the copyright and license notice in copies you ship.
- Do I have to host it on Vercel? No. Any host that runs Node.js or Docker supports all features; a static export runs on any plain web server with fewer features.
- App Router or Pages Router? New projects use the App Router, the newer one with Server Components. The Pages Router is the original one and is still supported; their docs are separate.
- Where did middleware.ts go in version 16? It was renamed to proxy.ts with a proxy function. The proxy file always runs on Node.js; apps that need the edge runtime keep middleware for now.
- Does it send data about my project anywhere? Anonymous usage data about commands and builds goes to Vercel unless you turn it off with NEXT_TELEMETRY_DISABLED=1.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
