Recipes · recipe
Recipe — social share card (OG-style PNG)
Current Apexify.js 6.0.0 documentation for Recipe — social share card (OG-style PNG).
Goal: A 1200×630 Open-Graph-style card — dark background + headline — written to disk with painter.save.
Prerequisites: Node ≥16, apexify.js installed, writable ./out (or change directory).
Steps
- Instantiate
ApexPainter(constructortypeoptional here — we save raw PNG bytes). createCanvas— wide banner/colorBg.createText— large headline onto theCanvasResults.save— timestamped/counter filename underdirectory.
Full example
SOURCEtypescript
typescript
Variations
| Want | Change |
|---|---|
Logo / avatar | Add createImage — Images overview |
| Gradient backdrop | createCanvas gradients / BG layers — Canvas overview |
| Return base64 for an API | new ApexPainter({ type: 'base64' }) + await painter.outPut(png) — Output encoding |