Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-screensnaps

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-screensnaps

![Build](https://github.com/Team-GC/node-screensnaps/workflows/CI/badge.svg)

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-screensnaps

Build

A simple NodeJS library to interact with the APIs for screenshot generation on screensnaps.io. Please note that this library requires a back-end server (nodejs), as screensnaps.io does not support CORS from the client side.

Installation

npm install node-screensnaps

or

yarn add node-screensnaps

Documentation

To get stared, you'll need an api_key and user_id to make requests, you can sign up for free at https://screensnaps.io.

Initializing the Library

const screensnapsIO = require('node-screensnaps')

OR

import * as screensnapsIO from "node-screensnaps"

Methods

Refer to the documentation on https://screensnaps.io/docs/intro on how to make certain calls.

Promises

By default, this library uses promises, you can invoke them as via await, but remember to handle your own errors via try / catch. Example below use async/await, however can be written as a true promise.

screenshots

This will get the last 15 screenshots on your account.

const snaps = await screensnapsIO.screenshots({
    userId: "USER_ID",
    apiKey: "API_KEY"
});

screenshot

This will take a screenshot to a URL or HTML depending on your params

const snap = await screensnapsIO.screenshot({
    userId: "USER_ID",
    apiKey: "API_KEY"
}, {
    url: "https://google.com"
});

See https://screensnaps.io/docs/api-post-screenshot for additional parameters.

stats

This is a ping to let you know the status of the service.

const status = await screensnapsIO.status({
    userId: "USER_ID",
    apiKey: "API_KEY"
});

Testing

You can run npm run test to run then test. Make sure to create a local .env file with the contents of:

USER_ID=XXXX
API_KEY=XXXX

You can pull these from dashboard at https://screensnaps.io

FAQs

Package last updated on 18 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc