Skip to main content
Each method takes a template id and an options object. Every option is optional.

Create an image

createImage renders the template and returns the image bytes.
string
required
The template id, for example tpl_xxx.
Modification[]
The values to put into the template’s layers. Each entry names a layer with name. Layers you leave out keep the values from the template. Modifications lists the fields each layer accepts.
'png' | 'jpeg' | 'webp'
default:"png"
The image format.
result is an ArrayBuffer. In a browser or an edge runtime, send it as the body of a Response and set the Content-Type header to the image type.

Create a PDF

createPdf takes the same templateId and modifications. It has no format option.

Create a stored image

createStoredImage renders the image, saves it, and returns a URL instead of the bytes. Use it when you want to put the link in an email, a database row, or a no-code tool. It accepts the options of createImage, plus s3Config.
S3Config
Save the file to your own S3-compatible bucket. This needs the Scale or Enterprise plan. Without it, Bannerify saves the file on its CDN and returns a link that starts with https://images.bannerify.co/files/.
An S3Config has these fields:

Handle the result

All three methods return { result } or { error }. See Handle errors.