Search across all documentation pages
9 pages in this section.
Protect pages and API routes in a Next.js 15+ App Router application using middleware-based session checks, server-side auth validation, and per-page guarding.
Build type-safe REST API endpoints using Next.js 15+ App Router Route Handlers with NextRequest, NextResponse, request validation, and proper HTTP status codes.
Configure and safely use environment variables in Next.js 15+ with .env files, the NEXTPUBLIC prefix for client exposure, runtime config, and the server-only pa
Handle errors gracefully in Next.js 15+ App Router using error.tsx boundaries, global-error.tsx for root-level failures, not-found.tsx for 404s, and structured
Test React Server Components, Server Actions, Route Handlers, and Client Components in a Next.js 15+ App Router project using Vitest and React Testing Library.
Deploy a Next.js 15+ App Router application using standalone output mode, Docker containers, edge runtime functions, and platform-specific optimizations.
Implement SEO best practices in Next.js 15+ App Router using the Metadata API, dynamic generateMetadata, sitemaps, robots.txt, Open Graph images, and JSON-LD st
Add multi-language support to a Next.js 15+ App Router application with locale-based routing, translation loading, locale detection via middleware, and SEO-frie
A condensed summary of the 25 most important best practices drawn from every page in this section.