🚀 DAY 3 OF LAUNCH WEEK: Introducing Webhook Events for Pull Request Scans.Learn more →
Socket
Book a DemoInstallSign in
Socket

sealninja-sdk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sealninja-sdk

Sealninja JavaScript SDK

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Sealninja JavaScript SDK

Document Sealing as a Service

NPM version Dependency Status

Installation

npm install --save sealninja-sdk

Configuration

Create a sealninja object by using new Sealninja({ apiKey, [certificate, privateKey] }). The arguments are:

  • apiKey - your Sealninja API key
  • certificate - (optional) your certificate when using mutual TLS
  • privateKey - (optional) your private key when using mutual TLS
import Sealninja from 'sealninja-sdk';

const sealninja = new Sealninja({
  apiKey: YOUR_API_KEY,
});

Seal document

To seal a document, use .seal(file, [details, [filename]]). The arguments are:

  • file - either string with file path or Buffer object
  • details - (optional) data object to be included in the seal
  • filename - (optional) filename in case file is provided as Buffer object

This function returns the sealed document as a Buffer object.

// seal a document
const sealedDocument = await sealninja.seal('path/to/invoice.pdf');

// seal a document with additional details in the seal
const sealedDocumentWithDetails = await sealninja.seal('path/to/invoice.pdf', { "seller": "John", "price": 100 });

// seal a document form a buffer
const sealedDocumentFromBuffer = await sealninja.seal(documentBuffer, null, 'test.xml');

Verify document

To verify a document, use .verify(file, [filename]). The arguments are:

  • file - either string with file path or Buffer object
  • filename - (optional) filename in case file is provided as Buffer object

This function returns the seal of the document, when it could be verified.

// verify a document
const seal = await sealninja.verify('path/to/invoice.pdf');

// verify a document form a buffer
const sealFromBuffer = await sealninja.verify(documentBuffer, 'test.xml');

Documentation

More information on Sealninja can be found in the Sealninja documentation.

License

MIT

Sealninja

Keywords

Sealninja

FAQs

Package last updated on 01 Aug 2019

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