Skip to main content

Request

Template

templateId
string
required
Unique template identifier (for example tpl_xxxxxxxxx).

Options

modifications
Modification[]
required
Layer overrides that Bannerify applies before rendering. Each modification must reference the layer name defined in the editor. See the modification reference for supported properties (text, images, tables, charts, etc.).
format
'png' | 'jpeg' | 'webp'
Output format. Defaults to png.
nocache
boolean
Set to true when you need a fresh render that bypasses the CDN cache.
import { writeFile } from "node:fs/promises"

const { result, error } = await bannerify.createImage("tpl_catalog", {
  modifications: [
    { name: "headline", text: "Launch promo" },
    { name: "price", text: "$29" },
  ],
  format: "png",
})

if (error) {
  console.error(error.message)
  return
}

await writeFile("launch-promo.png", Buffer.from(result))

Response

type CreateImageResult =
  | { result: ArrayBuffer; error?: never }
  | { result?: never; error: { code: string; message: string; docs: string; requestId: string } }
Use generateImageSignedUrl or createStoredImage when you prefer a ready-to-share URL instead of handling binary data directly.