Adapter configuration
Configure the adapter in theexperimental section of your Next.js config.
Path to the adapter package. Use
require.resolve('@next-community/adapter-vercel') to automatically resolve the installed package path.Image optimization
The adapter automatically configures Vercel’s image optimization based on your Next.js image configuration.Image sizes
Array of image widths for responsive images. Combined with
deviceSizes to generate the full set of optimized image sizes.Array of device widths for responsive images. Combined with
imageSizes to generate the full set of optimized image sizes.Image domains and patterns
Array of allowed external domains for image optimization. For more control, use
remotePatterns instead.Array of remote URL patterns allowed for image optimization.Each pattern can specify:
protocol:'http'or'https'(optional)hostname: Domain name (supports wildcards)port: Port number (optional)pathname: URL path pattern (optional)search: Query string pattern (optional)
Array of local file patterns allowed for image optimization.Each pattern can specify:
pathname: File path pattern (optional)search: Query string pattern (optional)
Image quality and formats
Array of quality values for image optimization. Values should be between 1 and 100.
Array of supported image formats. Supported values:
'image/avif', 'image/webp'Image caching and security
Minimum cache TTL in seconds for optimized images.
Allow SVG images to be optimized. Use with caution as SVG files can contain scripts.
Content Security Policy header for image responses.
Content-Disposition header type for image responses.
Example configuration
next.config.ts
Internationalization
The adapter supports Next.js i18n configuration and automatically generates locale-specific routes.Array of all supported locales.
Default locale for the application.
Array of domain-specific locale configurations.Each domain can specify:
domain: Domain namedefaultLocale: Default locale for this domainlocales: Supported locales for this domain (optional)http: Use HTTP instead of HTTPS (optional)
Enable automatic locale detection based on Accept-Language header.
Example i18n configuration
next.config.ts
Base path and trailing slash
Base path for the application. All routes will be prefixed with this path.
Add trailing slashes to URLs.
next.config.ts