npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

one-span-sign

v2.6.0

Published

Node module for the One Span E-Sign API.

Downloads

39

Readme

One Span Sign

This project is an open source node module for interracting with the popular One Span Sign (formerly eSignLive) REST API.

Installation

npm install -g one-span-sign
npm install --save one-span-sign

Getting Started

In order to call the One Span Sign API, you will need to be setup wit an API Key. You will likely have both a sandbox API Key and a production API Key.

Production (Default)

The default API domain is 'apps.esignlive.com'. Documentation here for more info.

const OneSpanClient = require('one-span-sign');

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE'});
const response = await client.createPackage(...); //See below for arguments here
Production (Custom Domain)

For alternative domains, see here.

const OneSpanClient = require('one-span-sign');

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE', domain: 'apps.e-signlive.ca'}); // Canadian domain, for example
const response = await client.createPackage(...); //See below for arguments here
Sandbox/Dev (Default)

The default API domain is 'sandbox.esignlive.com'. Documentation here for more info.

const OneSpanClient = require('one-span-sign');

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE', sandbox: true});
const response = await client.createPackage(...); //See below for arguments here
Sandbox/Dev (Custom Domain)

For alternative domains, see here.

const OneSpanClient = require('one-span-sign');

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE', sandbox: true, sandboxDomain: 'signer-sandbox-gov.esignlive.com'}); // Government domain, for example
const response = await client.createPackage(...); //See below for arguments here

Methods

getPackage(id)

One Span Documentation

An existing package can be retrieved via the package id returned after creation.

const OneSpanClient = require('one-span-sign');

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE'});
const response = await client.getPackage('PACKAGE_ID_HERE');

getPackages([query])

One Span Documentation

An existing list of packages can be retrieved.

const OneSpanClient = require('one-span-sign');

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE'});
const response = await client.getPackages({sort: 'created'});

/** 
You can pass-in optional query params that are appended to the request
The default query is {from: 0, to: 100}, which returns 100 packages
*/

getPackageSigningUrl(id, roleOrSigner)

One Span Documentation

Retrieves the signing url for a particular role.

const OneSpanClient = require('one-span-sign');
const { Signer } = OneSpanClient;

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE'});
const responseA = await client.getPackageSigningUrl('PACKAGE_ID_HERE', 'ROLE_HERE');

console.log(responseA.url); // Signing url

/**
  OR
*/

const responseB = await client.getPackageSigningUrl('PACKAGE_ID_HERE', new Signer({role: 'ROLE_HERE'}));

console.log(responseB.url); // Signing url

createPackage(package)

One Span Documentation

Packages should be assembled using the Document, Field, and Signer models from the library.

const OneSpanClient = require('one-span-sign');
const { Document, Field, Signer } = OneSpanClient;

const client = new OneSpanClient({apiKey: 'YOUR_KEY_HERE'});
const response = await client.createPackage(
      'Income Tax', // name
      'Income Tax Form', // description
      [
          new Document({
            name: 'Income Tax Form',
            file: 'local/path/to.pdf',
            signatureFields: [
              new Field({
                name: 'sigPrep',
                role: 'Cheese'
              }),
              new Field({
                name: 'f1-66',
                role: 'Crackers',
                template: { subtype: 'CAPTURE' }
              })
            ]
          })
      ], // documents
      [
        new Signer({
          role: 'Cheese',
          firstName: 'Rollo',
          lastName: 'Sly',
          email: '[email protected]'
        }),
        new Signer({
          role: 'Crackers',
          firstName: 'Mitch',
          lastName: 'Kooly',
          email: '[email protected]'
        })
      ] // signers
      );

Upcoming Additions

  • getPackageSigningStatus()
  • updatePackage()
  • deletePackage()
  • clonePackage()
  • getDocument()

Contribution Guidelines

Fork the respository and install all the dependencies:

npm install

Run the npm setup script in the project root directory:

npm run setup

Make sure to run the unit tests before committing. Obviously, add to the tests as you make changes:

npm run test

For watch:

npm run test:watch