Node.js
Get started with Orshot Node SDK
Installation
Import
Initialise
Render from a template
Generate a Signed URL
Examples
base64 response format
url response format
binary response format
This example writes the binary image to the file og.png in the current directory.
renderFromTemplate
Use this function to render an image/pdf. Render template takes in 4 options passed as an object
| key | required | description | 
|---|---|---|
templateId | Yes | ID of the template (open-graph-image-1, tweet-image-1, beautify-screenshot-1, ...) | 
modifications | Yes | Modifications for the selected template. | 
responseType | No | base64, binary, url (Defaults to base64). | 
responseFormat | No | png, webp, pdf, jpg, jpeg (Defaults to png). | 
For available templates and their modifications refer Orshot Templates Page
generateSignedUrl
Use this function to generate signed URLs
| key | required | description | 
|---|---|---|
templateId | Yes | ID of the template (open-graph-image-1, tweet-image-1, beautify-screenshot-1, ...) | 
modifications | Yes | Modifications for the selected template. | 
expiresAt | Yes | Expires at in unix timestamp (Number). | 
renderType | No | images, pdfs (Defaults to images). | 
responseFormat | No | png, webp, pdf, jpg, jpeg (Defaults to png). |