Satori-bg is a community fork of Vercel's Satori library (v1.1.3) that adds basic support for background images on HTML elements. The original Satori is an enlightened library to convert HTML and CSS (via JSX) to SVG, primarily used for generating Open Graph images and social cards. It uses a Flexbox layout engine (Yoga) and supports a limited subset of HTML and CSS. Satori is maintained actively by Vercel and releases are frequent. Differentiators from alternatives like Puppeteer or Playwright: no headless browser needed, works on edge runtimes, produces deterministic SVG output. This fork specifically adds background-image support (not present in original Satori). Node.js >=16 required, ships TypeScript types.
npm install satori-bgNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using satori-bg with a non-JSX object, fetching a font, and including a background image.
Check the fork's documentation for differences. Use original satori if you don't need background-image support.
Use the object format (type, props) instead of JSX tags.
Test your CSS thoroughly. Rely on standard Flexbox properties.
Fetch or read font files and pass them as ArrayBuffer or Buffer in the fonts array.
Upgrade Node.js to version 16 or later.
Add a font entry with the correct name, weight, and style matching your text.
Use ES module import syntax: import satori from 'satori-bg'
Install yoga-layout-prebuilt: npm install yoga-layout-prebuilt
Ensure you pass a valid JSX element or object with type and props.