Satori

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

Library
npm
v0.33.5
13,987 stars
Mozilla Public License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
82 /100 Excellent
Development Activity 80
Maintenance 88
Community 64
Maturity 56
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
85 /100 Excellent
Architecture 88
Code Quality 90
Innovation 85
Learning Curve 78

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
93%
MIT

bunqueue

Developer Tools · Devops

570

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

View details
73
Repo Health
83
Technical
72
Dependency
Built with
TypeScript 93%
Updated 3 weeks ago
TypeScript
92%
AGPL 3.0

Documenso

Digital Signiture

15,224

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
68
Dependency
Built with
TypeScript 92%
Updated 5 days ago
TypeScript
82%
MIT

evidence

Analytics · Data Engineering

6,962

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
90
Repo Health
79
Technical
64
Dependency
Built with
TypeScript 82%
Svelte 17%
Updated 1 weeks ago
TypeScript
78%
LGPL 3.0

Latitude

AI Agents · Monitoring

4,686

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
TypeScript 78%
Rust 11%
Python 11%
Updated 1 weeks ago
JavaScript
88%
GPL 3.0

NodeBB

Community

15,227

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
70
Dependency
Built with
JavaScript 88%
Go Template 11%
Updated 5 days ago
HTML
36%

OpenPanel

Devops · Hosting Control Panel

749

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
84
Repo Health
75
Technical
63
Dependency
Built with
HTML 36%
Go 32%
TypeScript 23%
Updated 6 days ago
TypeScript
97%
MIT

Promptfoo

AI Development

25,506

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
TypeScript 97%
Updated 5 days ago
Rust
77%
Apache 2.0

SlateDB

Databases · Developer Tools

3,448

Embedded KV store built on object storage with zero replication cost

View details
87
Repo Health
73
Technical
72
Dependency
Built with
Rust 77%
Updated 1 weeks ago
TypeScript
51%
Other

World Monitor

Analytics · Monitoring

87,476

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
87
Repo Health
89
Technical
68
Dependency
Built with
TypeScript 51%
JavaScript 47%
Updated 5 days ago

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