This is an app I built to play with Vercel’s image generation library.
Have a look at the serverless function in pages/api/github.tsx. It’s where the image is generated.
If you’re curious how image generation works, check out this tutorial I wrote on my blog.
And if you’re interested in Next.js, also check out the book I wrote about it.