Node.js · HTML to Image
Convert HTML to Image in Node.js
Drop Puppeteer overhead and call the renderpix REST API directly. Works in any Node.js version — Express, NestJS, plain scripts, serverless functions.
JavaScriptrenderpix API example
const html = ` <div style="padding:48px;background:#0f172a;color:white; font-family:sans-serif;border-radius:12px;width:800px"> <h1 style="font-size:36px">Invoice #INV-2026-042</h1> <p style="color:#94a3b8">Total: $129.00</p> </div> `; const res = await fetch("https://renderpix.dev/v1/render", { method: "POST", headers: { "X-API-Key": "rpx_your_key", "Content-Type": "application/json", }, body: JSON.stringify({ html, width: 800, height: 400, format: "png" }), }); const buffer = Buffer.from(await res.arrayBuffer()); fs.writeFileSync("invoice.png", buffer); console.log(`Saved ${buffer.length / 1024 | 0} KB`);
Common use cases
Express APIs
Add an image generation endpoint to your Express server in minutes.
Serverless
Deploy on Vercel, Netlify, or AWS Lambda without binary dependencies.
Email renders
Pre-render email images server-side for better compatibility.
Batch jobs
Generate thousands of personalized images in a nightly job.
Start converting HTML to images for free
100 free renders/month. No credit card. Set up in 2 minutes.
Get free API key