A service that generates dynamic Covers & Open Graph images for Bhilai Hacks Hackathon.
Use the generated image URL in the <head>
of your HTML document as the og:image meta property
<meta property="og:image" content="https://cover-machine.vercel.app/api/image?fileType=png&layoutName=Simple&Text=**Hello**+_World_" />
Whenever this image is requested (e.g. in link previews) the image will be generated on demand.
Download the Image in PNG/JPEG and use it for free.
Images are generated through the /api/image
route. When you hit this route the following happens
- Query params are parsed
- HTML page built, rendered with Puppeteer, and screenshot
- Screenshot returned with a long cache max age
You can fork this repo, customize, and use in your own projects.
The frontend is a NextJS site and the image generation happens in an API route.
# Install all dependencies
yarn
# Start local development server
yarn dev
# Build for production
yarn build
# Start in production
yarn start
Credit where credit is due. This started as a forked repo from Vercel's OG image generator.
Pranjal Bareth |
Thank you for being here!