Next.js Complete Reference Index

Select any item below to open its full syntax specification, parameters, and live example.

Next.js Tutorial

Configuration

11 entries
Allow reviewed development originsallowedDevOrigins: string[]
allowedDevOrigins names additional hosts for development requests. It is not a production CORS or authentication setting; the reviewed documentation notes that automatic cross-origin blocking behavior is evolving. Keep the server private, prefer narrow exact hosts over wildcards, and test actual behavior. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Bounded static generation tuningexperimental.staticGenerationMaxConcurrency (and related flags)
Experimental staticGenerationMaxConcurrency bounds pages processed per worker, not all upstream requests or total workers. staticGenerationRetryCount controls failed-generation retries. Keep upstream concurrency and timeouts independently bounded and compare clean builds. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/staticGeneration. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Cache Components configurationcacheComponents: true
Application-wide opt-in for the new caching/rendering lane. Review incompatible segment options; not a universal cache-all switch. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents
Canonical alternatealternates: { canonical: string }
Preferred URL signal, not authorization or an indexing guarantee. Source: https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
Client router segment stale timesexperimental.staleTimes.static; experimental.staleTimes.dynamic
Experimental staleTimes adjusts client router cache retention in seconds. Static and dynamic values are not server data expiration, and are not an authorization boundary. Compare ordinary navigation with history navigation and refresh in an isolated compatible lane; avoid production adoption without exact-version review. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/staleTimes. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Configuration headersasync headers()
Define an async headers function returning source patterns and key/value pairs. Test the final response after framework and proxy processing. Truly immutable hashed assets receive a framework-controlled cache policy; do not assume configuration can override it. These public security headers are not a complete security policy. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/headers. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Configuration redirectsasync redirects()
Define an async redirects function returning rules with source, destination and permanent. A temporary rule returns 307; a permanent rule returns 308. Both preserve the original HTTP method. Test destination support and avoid redirect loops. The example changes only an old public catalog URL. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Configuration rewritesasync rewrites()
Return a simple rewrite array or phase-specific beforeFiles, afterFiles and fallback arrays. A rewrite serves the destination while retaining the visible request URL. Choose the phase deliberately; test collisions with files and dynamic routes. Do not use an untrusted external destination. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Custom build directorydistDir: string
distDir changes the build directory within the project. Adapt artifact-copy and cleanup steps to the configured path; never allow cleanup outside a disposable build root. This configuration is an example, not a filesystem sandbox. Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/distDir. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Custom deployment adapter selectionadapterPath / NEXT_ADAPTER_PATH; version-specific placement
A deployment adapter integrates with framework build outputs. Documentation and flag placement have evolved; older docs show experimental.adapterPath, newer adapter docs discuss adapterPath. Exact placement and interface must be resolved from the chosen release before use. Example context: isolated Next.js 16.x candidate; snippet is partial unless it defines a complete convention file. Lifecycle: version-review. Expected behavior / verification: Check exported adapter lifecycle against the exact release, then exercise runtime and cache capabilities independently. Do not load arbitrary adapter code. Source: https://nextjs.org/docs/app/api-reference/adapters Exact installed signature, typecheck and framework execution not run.
Customize the Webpack buildwebpack(config, context) returns config
Customize Webpack with a callback that preserves and returns its configuration. The documented calls cover client and server targets, including Node and Edge. The callback is not a Turbopack hook. Use explicit Webpack selection in a reviewed build; custom configuration may require maintenance across framework releases. Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/webpack. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.

File conventions

5 entries
App Router MDX component mappingmdx-components.tsx; useMDXComponents()
With @next/mdx in the App Router, place mdx-components.tsx alongside app or in the corresponding src root. Export useMDXComponents to provide element overrides. Install and configure compatible MDX dependencies separately. Only compile trusted, reviewed MDX because expressions and imports can execute code. Source: https://nextjs.org/docs/app/api-reference/file-conventions/mdx-components. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
App Router pageapp/<segment>/page.tsx
A default-exported component supplies UI for a segment. A page at app/page.tsx serves the root path in the ordinary App Router tree.
App icons: favicon, icon and apple-iconapp/favicon.ico; app/icon.png; app/apple-icon.png
Special metadata filenames create corresponding browser icon links. favicon.ico belongs at the app root; icon and apple-icon can be segment-specific. Supply appropriate original binary images rather than renaming arbitrary files to .png. Generated icons have additional version-specific contracts. Example context: Next.js 16.x documentation lane; illustrative snippet or file tree, not executed. Exact candidate patch 16.4.6 remains unverified. Expected behavior / verification: With real valid local icon assets, inspect generated link tags and request the referenced URLs. Verify MIME type and actual image bytes; filenames alone do not prove valid images.
Catch-all and optional catch-allapp/guide/[...parts]/page.tsx or app/guide/[[...parts]]/page.tsx
Required catch-all captures one or more segments as string[]. Optional also matches the parent URL, where the value is undefined. These are alternative routes, not simultaneous declarations. Source: https://nextjs.org/docs/app/api-reference/file-conventions/dynamic-routes. Draft; examples are illustrative snippets, not complete runnable programs.
Client instrumentationinstrumentation-client.ts
Place lightweight synchronous startup code in instrumentation-client.ts at the project root (or src root). It runs early in the browser; async imports and promises need not finish before React hydration. This local mark is not a measure of interactivity or an external telemetry upload. Source: https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation-client. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.

Styling

1 entry

Rendering

1 entry

Integration

1 entry

Performance

1 entry

Showing 20 of 219 entries