Every small product I ship ends up needing one of two things: an Open Graph image, or a PDF of some HTML I already have.
Self-hosting Playwright or Puppeteer works . It also:
creeps up in memory until the box runs out
leaves Chrome hanging when a page never finishes loading
captures a GDPR banner over the thing you actually wanted
turns a weekend feature into an ops job
So I put it behind one endpoint, and it's now live as FrameForge : HTML or a URL in, PNG, JPEG or PDF out.
The request
curl -X POST https://95-217-220-34.sslip.io/render \ -H "X-API-Key: $KEY" \ -H "Content-Type: application/json" \ -d '{"html":"<!doctype html><h1>Invoice 1042</h1>","format":"pdf"}' \ -o invoice.pdf
Enter fullscreen mode
Exit fullscreen mode
Swap html for url , or pdf for png / jpeg . width and height go up to 3840 and fullPage captures the whole page.
Design choices I made on purpose
One browser, a new context per request. Sharing tabs is how cookies and memory leaks spread between jobs.…