You can use the following code sample to explore using parameters and different content types with OG Image Generation. To learn more, see Open Graph Image Generation.
Create an api route with route.tsx in /app/api/og/ and paste the following code:
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:
Then, browse to http://localhost:3000/api/og. You will see the generated image.
