@websiteshot/nodejs-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

Websiteshot NodeJS Client


Never spend time again to create awesome screenshots of your websites.


Installation

npm i @websiteshot/nodejs-client --save

Usage

Import Controller and Types

import {
  Config,
  CreateRequest,
  ScreenshotParameter,
  Url,
  WebsiteshotController,
} from '@websiteshot/nodejs-client'

Init Client

const config: Config = {
  projectId: '...',
  apikey: '...',
}

const websiteshotController = new WebsiteshotController(config)

Create Screenshot Job

const screenshotParameter: ScreenshotParameter = {
  width: 1200,
  height: 720,
}

const urls: Url[] = [
  {
    url: 'https://websiteshot.app',
    name: 'Websiteshot',
  },
]

const createRequest: CreateRequest = {
  screenshotParameter,
  urls,
}

await websiteshotController.create(createRequest)

Create Screenshot Job with Template

const createRequest: CreateRequest = {
  templateId: '...',
}

await websiteshotController.create(createRequest)

Get Screenshot Jobs

const config: Config = {
  projectId: '...',
  apikey: '...',
}

const websiteshotController = new WebsiteshotController(config)

const response: GetResponse = await websiteshotController.get(jobId)

Readme

Keywords

none

Package Sidebar

Install

npm i @websiteshot/nodejs-client

Weekly Downloads

11

Version

0.0.10

License

ISC

Unpacked Size

22.9 kB

Total Files

30

Last publish

Collaborators

  • urbanisierung