Generate SEO-friendly metadata for your Next.js pages including OpenGraph and Twitter/X cards.
Add metadata directly to your pages using the Meta.generate function:
For larger sites, store your metadata in a central configuration file to maintain consistency across pages:
Store your site-wide metadata in a configuration file:
Reference the configuration in your pages:
This approach makes it easier to maintain consistent metadata across your site and update it from a single location.
Without an image, Meta.generate points the Open Graph and X images at /api/og/generate?title=…, a route you render with next/og. If yours lives elsewhere, pass ogRoutes; the same object can be given to OgRoutesProvider for OgCard.
The Meta.generate function will generate all necessary meta tags for SEO and social sharing:
Meta.generate takes one object: