Static browser metadata
The web app has fixed metadata such as its name, description, and launch URL.
Next.js 16+ · Directive
Next.js App Router supports static or generated web app manifests. Put the manifest at the root of app and use either a JSON/webmanifest file or a JS/TS module returning a Manifest object.
Place a static manifest file or a manifest.ts/manifest.js function at the root of app. Next.js uses it to provide browser-facing web application metadata that follows the Web Manifest Specification.
app/manifest.(json|webmanifest)
app/manifest.(js|ts) → ManifestA Manifest object from a dynamic manifest module; static files contain the manifest directly.
.json or .webmanifest filename convention.app directory.// app/manifest.ts
import type { MetadataRoute } from 'next'
export default function manifest(): MetadataRoute.Manifest {
return {
name: 'My Next.js Application',
short_name: 'Next.js App',
description: 'An application built with Next.js',
start_url: '/',
}
}Create this file at the root of the app directory to generate the web app manifest.
The web app has fixed metadata such as its name, description, and launch URL.
Manifest values need to be produced by application code.
The application needs browser-recognized web app information for install-oriented experiences.
Next.js supports static app/manifest.json or app/manifest.webmanifest files, as well as dynamic app/manifest.js or app/manifest.ts files. A dynamic file must return a Manifest object.
Follow-up: How would you choose between the two? Use a static file for fixed metadata and a function when the manifest needs to be generated dynamically.
The manifest describes the web application for the browser and must match the Web Manifest Specification. Typical fields include the application name, short name, description, and start URL.
Follow-up: What additional manifest data might be needed for installation? Add specification-supported fields such as icons and display settings when the application requires them.
For a dynamic manifest, export a function from app/manifest.ts or app/manifest.js that returns the manifest object. The returned object contains the web app metadata consumed by the browser.
Follow-up: Where should the function be located? At the root of the app directory, using the documented manifest file convention.
MetadataRoute.Manifestapp/manifest.jsonapp/manifest.webmanifestapp/manifest.jsapp/manifest.tsWeb Manifest Specification