opengraph-image.tsx

A special file in a route folder that generates or provides the route's Open Graph image, with Next.js adding the meta tags automatically.

In more detail

As a .tsx file it returns an ImageResponse built from JSX; as .png or .jpg it is used as is. Generated images are statically optimised and cached unless they use dynamic data.

Related terms

Taught in

References