@flowframe/node-previewify
v0.1.0
Published
The official Previewify node.js SDK
Downloads
6
Readme
Previewify for Node.js
This is the official Previewify client for Node.js.
Installation
You can install the package via NPM:
npm install @flowframe/node-previewify
Usage
Creating an instance
const { Previewify } = require('@flowframe/node-previewify')
const previewify = new Previewify({ apiToken: '<YOUR_API_TOKEN>' })
Methods
// List sites
previewify
.listSites()
.then(response => response.data)
// Show site
let siteId = 1
previewify
.showSite(siteId)
.then(response => response.data)
// Show site's templates
let siteId = 1
previewify
.listSiteTemplates(siteId)
.then(response => response.data)
// Generate a direct image URL (useful for downloading and storing images yourself)
let siteId = 1
let templateId = 1
let fields = {
'previewify:title': 'Hello from Node.js!',
'previewify:subtitle': 'This is an example...',
}
previewify
.downloadImage({
siteId,
templateId,
fields,
})
.then(response => response.data)
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.