Skip to content

techulus/capture-node

Repository files navigation

Capture Node SDK

Node Library for Capture by Techulus

Get your API Key and Secret from https://capture.techulus.in/console

Installation

npm install capture-node

Usage

List of all capture options: https://docs.capture.techulus.in

Image

import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);

// var url = capture.buildImageUrl(URL_TO_CAPTURE, CAPTURE_OPTIONS);

const url = capture.buildImageUrl('https://capture.techulus.in/', {
    full: true,
    delay: 3,
    t: Date.now()
});

Now stick that url in an img tag to render the screenshot!

PDF

import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);

// var url = capture.buildPdfUrl(URL_TO_CAPTURE, CAPTURE_OPTIONS);

const url = capture.buildPdfUrl('https://capture.techulus.in/', {
    full: true,
    delay: 3,
    t: Date.now()
});

Content

import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);

// var url = capture.buildContentUrl(URL_TO_CAPTURE, CAPTURE_OPTIONS);

const url = capture.buildContentUrl('https://capture.techulus.in/');

Metadata

import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);

// var url = capture.buildMetadataUrl(URL_TO_CAPTURE, CAPTURE_OPTIONS);

const url = capture.buildMetadataUrl('https://capture.techulus.in/');