Satori

Convert HTML and CSS into pixel-accurate SVG images using a built-in flexbox layout engine.

Library
npm
v0.29.0
13,786stars
Mozilla Public License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
74/100Good
Development Activity60
Maintenance76
Community64
Maturity56
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture88
Code Quality90
Innovation85
Learning Curve78

Satori is a TypeScript library that renders HTML and CSS as SVG, giving JavaScript and Node.js applications a way to generate images programmatically instead of relying on a headless browser. It implements its own layout engine (via Yoga’s flexbox model), font shaping, and CSS subset directly in JavaScript, so it runs in constrained environments like serverless functions and edge runtimes.

Built and maintained by Vercel, Satori is best known as the engine behind dynamic Open Graph image generation — accepting JSX-like element trees with inline styles and producing an SVG string that can be rasterized to PNG. It supports a deliberately curated subset of CSS (flexbox, borders, gradients, text wrapping, custom fonts, emoji) rather than the full spec, trading completeness for speed and portability.

What You Get

  • A satori() function that renders JSX/React-element trees plus font buffers into an SVG string, runnable in Node.js, Deno, browsers, and edge/serverless runtimes
  • A self-contained flexbox layout engine (via the yoga-layout WASM/JS binding) implementing CSS flexbox semantics without a browser
  • A curated CSS-in-JS style subset: borders, border-radius, gradients (linear/radial/conic), box-shadow, transforms, clip-path, and text properties like line-clamp and letter-spacing
  • Built-in emoji and multi-language (CJK, RTL) text segmentation and shaping via linebreak and custom Unicode handling
  • A satori/wasm and standalone build variant for environments without native Node.js APIs (e.g. Cloudflare Workers)
  • An experimental built-in JSX runtime (satori/jsx) so consumers don’t need to depend on React just to author element trees

Common Use Cases

  • Generating dynamic Open Graph and social-card images at request time for blog posts, product pages, or user profiles
  • Producing programmatic certificates, badges, or receipts as SVG/PNG without a browser dependency
  • Rendering data-driven graphics (e.g. personalized share images) inside serverless functions or edge middleware where spinning up a headless browser is impractical
  • Building custom screenshot/thumbnail services that need predictable, fast SVG output instead of full-page browser rendering

Under The Hood

Architecture: src/satori.ts is the entry point — it initializes a Yoga WASM/JS layout tree, wraps the caller’s element in an inherited-style context (default font, color, whitespace), and hands off to src/layout.ts, an async generator that walks the element tree, resolves per-node styles via src/handler/compute.ts, and mutates the Yoga node graph. Once layout is calculated (root.calculateLayout), the same generator resumes to walk the tree a second time and emit SVG fragments, which src/builder/*.ts modules (rect, text, gradient, border-radius, clip-path, shadow, transform) turn into path/shape primitives, finally assembled by src/builder/svg.ts into a single <svg> string. Font shaping lives in src/font.ts via @shuding/opentype.js, and image embedding/caching is handled in src/handler/image.ts.

Tech Stack: Pure TypeScript (98.7% of the codebase) with yoga-layout for flexbox, @shuding/opentype.js for glyph outlines, css-to-react-native/css-gradient-parser/postcss-value-parser/parse-css-color for CSS parsing, and linebreak for Unicode text segmentation. Built with tsup, targeting multiple output formats (ESM/CJS/standalone WASM/browser) so the same source ships to Node.js, Deno, browsers, and edge runtimes without a bundler-specific fork.

Code Quality: The test/ directory holds 48 focused test files (layout, flexbox-advanced, gradient, emoji, language, line-clamp, transform, etc.) run under Vitest with image-snapshot comparisons, plus a dedicated browser-build.mjs smoke test and strict TypeScript (tsc --noEmit) and ESLint/Prettier checks wired into ci-check. Types are used throughout (exported SatoriOptions, FontOptions, SatoriNode), and internal modules are small and single-purpose (e.g. transform-origin.ts, language.ts are each under 100 lines).

API Design: The public surface is a single async function — satori(element, options) — that mirrors familiar JSX/React-element conventions, so anyone who knows React props can start immediately; the fonts array and width/height options are the only required inputs beyond the tree itself. Advanced hooks (loadAdditionalAsset, onNodeDetected, graphemeImages) are opt-in and don’t complicate the basic path, and the library documents its supported CSS subset explicitly rather than silently failing on unsupported properties.

Used by 9 apps in this directory

TypeScript
91%
MIT

bunqueue

Developer Tools · Devops

535

High-performance job queue for Bun — SQLite persistence, cron scheduling, DLQ, S3 backups, and a native MCP server, all without Redis.

View details
74
Repo Health
83
Technical
76
Dependency
Built with
TypeScript91%
Updated 2 weeks ago
TypeScript
92%
AGPL 3.0

Documenso

Digital Signiture

14,603

Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.

View details
93
Repo Health
79
Technical
72
Dependency
Built with
TypeScript92%
Updated today
JavaScript
52%
MIT

evidence

Analytics · Data Engineering

6,861

Turn SQL queries and markdown files into polished, interactive data apps and business intelligence reports — no drag-and-drop, no GUI, just code.

View details
65
Repo Health
79
Technical
65
Dependency
Built with
JavaScript52%
Svelte40%
Updated today
TypeScript
79%
LGPL 3.0

Latitude

AI Agents · Monitoring

4,593

Open-source AI agent monitoring that catches what will break next before your users do.

View details
86
Repo Health
88
Technical
67
Dependency
Built with
TypeScript79%
Python11%
Updated today
JavaScript
87%
GPL 3.0

NodeBB

Community

15,199

Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.

View details
97
Repo Health
78
Technical
71
Dependency
Built with
JavaScript87%
Go Template12%
Updated today
HTML
32%

OpenPanel

Hosting Control Panel · Devops

733

Docker-powered web hosting control panel that gives every user a fully isolated environment with dedicated web server, database, and networking — VPS-grade security on shared hardware.

View details
81
Repo Health
75
Technical
63
Dependency
Built with
HTML32%
Go31%
TypeScript28%
Updated today
TypeScript
97%
MIT

Promptfoo

AI Development

24,362

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
68
Dependency
Built with
TypeScript97%
Updated yesterday
Rust
77%
Apache 2.0

SlateDB

Databases · Developer Tools

3,317

Embedded KV store built on object storage with zero replication cost

View details
88
Repo Health
73
Technical
77
Dependency
Built with
Rust77%
Updated today
TypeScript
52%
Other

World Monitor

Monitoring · Analytics

83,076

Real-time global intelligence dashboard that fuses AI-synthesized news, geopolitical risk scoring, and infrastructure tracking into one open-source situational awareness platform.

View details
86
Repo Health
89
Technical
71
Dependency
Built with
TypeScript52%
JavaScript45%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search