0.0.10 • Published 3 years ago

@websiteshot/nodejs-client v0.0.10

Weekly downloads
92
License
ISC
Repository
github
Last release
3 years ago

Websiteshot NodeJS Client

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)
0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago