Skip to content

Repository files navigation

@santi020k/og

Deterministic Open Graph image generation with useful visual presets and a fully custom renderer escape hatch.

Website · OG checker · npm · Package guide · Stability · Releases · Issues · Contributing

CI npm version npm downloads license

Use @santi020k/og with Astro, Next.js, plain Node.js, monorepos, Markdown collections, CMS data, or a static array. Start with the simple, article, docs, or product preset and add your content and brand. The package handles rendering, output paths, content-aware caching, bounded concurrency, safe cleanup, encoding, and CI verification. A custom Sharp or Satori renderer remains available when a project needs a unique composition. Framework-neutral metadata helpers reuse the same page definition for canonical, Open Graph, X, robots, plain HTML, and Next.js metadata. The website checker and santi-og inspect analyze the result for deployed and localhost projects.

Quick start

pnpm add -D @santi020k/og
pnpm exec santi-og init
pnpm exec santi-og generate

The generated og.config.mjs starts with the neutral product preset. Replace its sample cards, brand, and theme—there is no SVG template to maintain.

Visual examples

See all four presets rendered with real package output in the live gallery, then open the example-led documentation to copy a preset, portable metadata, Markdown content, Sharp, or Satori configuration. The package guide also covers static assets, worker threads, caching, cleanup, and migration guidance.

Workspace

Workspace Purpose Destination
packages/og Publishable generator, CLI, renderers, and programmatic API npm · Package guide
apps/web Astro website, branding, metadata, and social card Website

Development

pnpm install
pnpm dev

Run the complete package and website quality suite before shipping:

pnpm validate

The release gate also installs the packed package into plain Node.js, Astro, and Next.js projects:

pnpm test:consumers

Deployment and release

The website and its protected public-URL inspection function deploy to the santi020k-og Cloudflare Pages project when changes reach main. GitHub uses the website-production environment, the CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets, and these repository variables:

  • CLOUDFLARE_PAGES_PROJECT_NAME=santi020k-og
  • PUBLIC_SITE_URL=https://og.santi020k.com

Package releases are deliberate. Run the Release GitHub workflow with a version matching packages/og/package.json. The release environment must provide NPM_TOKEN; the workflow validates the repository, publishes with npm provenance, verifies the registry result, and then rebuilds registry-installed consumers before creating the matching Git tag and GitHub release. See the release acceptance checklist for the complete gate.

License

MIT. See LICENSE.

About

Renderer-agnostic Open Graph image generation with Sharp and Satori adapters.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages