Generate dynamic OG images with Next.js and vercel edge functions

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • og-image

    Discontinued Open Graph Image as a Service - generate cards for Twitter, Facebook, Slack, etc

  • Now here's the thing since these are part of the meta tags, and The image shown in the tags are ... well! images, making them dynamic is a bit tricky. generating images isn't a menial task that just every web server can do ... it's resource intensive, time-consuming and all the other nightmares. and making it part of your dynamic web app is another ball game altogether. So what's new? well, @vercel/og is, this library lets you build image content from HTML/React that too insanely fast, like really fast . and you can pair this with any edge network like AWS Lambda on the edge, Cloudflare workers, etc to make it even faster.

  • satori

    Enlightened library to convert HTML and CSS to SVG

  • and since the library uses Satori under the hood, it can run in virtually any environment [modern browsers, Node.js (any node compatible runtime), and Web Workers ] using webassembly.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • vercel

    Develop. Preview. Ship.

  • import type { GetServerSideProps, InferGetServerSidePropsType, NextPage } from 'next' import Head from 'next/head' import Image from 'next/image' import { useRouter } from 'next/router' import styles from '../styles/Home.module.css' export const getServerSideProps: GetServerSideProps = async (context) => { return { props:{ title: context.query?.title??' Mate' } } } const Home: NextPage = ({title}:InferGetServerSidePropsType) => { return (

    Hello There! {title}

    Welcome to Next.js!

    Get started by editing{' '} pages/index.tsx

    Documentation →

    Find in-depth information about Next.js features and API.

    Learn →

    Learn about Next.js in an interactive course with quizzes!

    Examples →

    Discover and deploy boilerplate example Next.js projects.

    Deploy →

    Instantly deploy your Next.js site to a public URL with Vercel.

    Powered by{' '} Vercel Logo
    ) } export default Home

  • Next.js

    The React Framework

  • import type { GetServerSideProps, InferGetServerSidePropsType, NextPage } from 'next' import Head from 'next/head' import Image from 'next/image' import { useRouter } from 'next/router' import styles from '../styles/Home.module.css' export const getServerSideProps: GetServerSideProps = async (context) => { return { props:{ title: context.query?.title??' Mate' } } } const Home: NextPage = ({title}:InferGetServerSidePropsType) => { return (

    Hello There! {title}

    Welcome to Next.js!

    Get started by editing{' '} pages/index.tsx

    Documentation →

    Find in-depth information about Next.js features and API.

    Learn →

    Learn about Next.js in an interactive course with quizzes!

    Examples →

    Discover and deploy boilerplate example Next.js projects.

    Deploy →

    Instantly deploy your Next.js site to a public URL with Vercel.

    Powered by{' '} Vercel Logo
    ) } export default Home

  • Tailwind CSS

    A utility-first CSS framework for rapid UI development.

  • For those utility-first folks out there it supports Tailwind as well.

  • next-dynamic-og-image

  • opengraph

    A python module to parse the Open Graph Protocol

  • Look at the Open Graph protocol for more details.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts