Good to know: ImageResponse satisfies this return type.
Config exports
You can optionally configure the image's metadata by exporting alt, size, and contentType variables from opengraph-image or twitter-image route.
OptionTypealtstringsize{ width: number; height: number }contentTypestring - image MIME type
alt
opengraph-image.tsx / twitter-image.tsx export const alt = 'My images alt text'
 
export default function Image() {}
<head> output <meta property="og:image:alt" content="My images alt text" />
size
opengraph-image.tsx / twitter-image.tsx export const size = { width: 1200, height: 630 }
 
export default function Image() {}
<head> output <meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
contentType