How workers-og works and its differences from @vercel/og
mainworkers-og is an og:image (social card) generator designed specifically for Cloudflare Workers. While it uses Vercel's Satori engine and mimics the @vercel/og API, it differs in two key ways:
- Runtime Compatibility: Unlike
@vercel/og, which is optimized for Vercel's edge runtime and may fail on Cloudflare Workers due to WASM bundling differences,workers-ogis built to run on Cloudflare Workers. - HTML Input Support: While Satori typically requires React elements as input,
workers-ogallows you to pass simple HTML strings. It uses Cloudflare's nativeHTMLRewriterAPI to parse the HTML into a React element-like object, making it easier to design images using standard web markup.