You can use the following code sample to explore using parameters and different content types with next/og. To learn more about OG Image Generation, see Open Graph Image Generation.
Create an API route handler:
If you're not using a framework, you must either add "type": "module" to your package.json or change your JavaScript Functions' file extensions from .js to .mjs
Preview the OG route locally by running the following command:
Then, browse to http://localhost:3000/api/og. You will see the following image:
