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

yousign-nodejs-api-wrapper

v1.8.0

Published

A Node.js API client for the YouSign signature API. Works as a wrapper around the Yousign PHP API client

Downloads

18

Readme

YouSign-NodeJS-API-Wrapper

A Node.js API client for the YouSign signature API. Works as a wrapper around the Yousign PHP API client

The original PHP Api : https://github.com/Yousign/yousign-api-client-php

Usage:

  1. Get a recent Node.js version (with ES6 support)
  2. Install PHP (version 7+ recommended). Make it so that you can run php by typing "php" in terminal
  3. Install this module into your project
npm i yousign-nodejs-api-wrapper --save
  1. Copy example_ysApiParameters.ini in the module's folder into your project root, rename it to ysApiParameters.ini
  2. Set your Yousign credentials into the file. Please note that if isEncryptedPassword = true your password must be in the following format : sha1(sha1(YOUR_PASSWORD)+sha1(YOUR_PASSWORD)) (with + being a concat operator). Otherwise set the boolean to false and just leave it as clear text. But that's bad mkay.
  3. Import the index.js module into your project
  4. Call the checkAuth() function (all functions are promise-based, so you can do .then and .catch on it

How to list signatures:

var ysAPIWrapper = require('yousign-nodejs-api-wrapper')

ysAPIWrapper.listSignatures("[email protected]").then((res)=>{
    console.log(res)
}).catch((err)=>{
    console.error(err)
})

Available functions :

checkAuth()

Checks if the YouSign API is up and if our credentials are valid

Kind: global function

initSignature(filesToSign, firstName, lastName, email, phone, signatures, userSuccessRedirectUrl, userCancelRedirectUrl, onSignatureStatusChangedUrl) ⇒ string | object

Inits a signature and returns the url of the signing page

Kind: global function Returns: string - iframeUrl - the url of the iframe to do the signatureobject - details - details of the signature, contains de demand ID which can be used later on

| Param | Type | Description | | --- | --- | --- | | filesToSign | array | An array of absolute paths to the documents that you wish to sign. Example : [/Users/joe/document1.pdf, /Users/joe/document2.pdf] Alternatively, you can send a string if you only have one file to sign Example : document1.pdf | | firstName | string | Firstname of the person that will sign | | lastName | string | Lastname of the person that will sign | | email | string | Email of the person that will sign | | phone | string | Phone of the person that will sign, including prefix (+33...). Must be a real Phone number as the user will receive an SMS confirmation code. | | signatures | array | An array of objects, each object containing the following data for a signature : page, document number, pixel coordinates of the rectangle where it will appear. Example for two signatures on page 2 and 4 on the first document of the filesToSign, and on page 2 of the second document: [{rectangleCoords: "337,59,572,98", page:"2", document:"1"}, {rectangleCoords: "337,193,572,232", page:"4", document:"1"}, {rectangleCoords: "100,200,300,400", page:"2", document:"2"}], If you only have one signature, and want to put on page 1 of first document, you can send only a string of coordinates instead of an array : "337,59,572,98" | | userSuccessRedirectUrl | string | A url where the user will be redirected to after he signs | | userCancelRedirectUrl | string | A url where the user will be redirected to after he cancels the signature process | | onSignatureStatusChangedUrl | string | The YouSign server will send GET requests to this url when the signature status changes. Statuses can be : init, cancel, waiting, signed, signed_complete |

downloadSignaturesFiles(search, absoluteOutFolderPath)

Downloads all the files in the signature process corresponding to the search parameter provided

Kind: global function

| Param | Type | Description | | --- | --- | --- | | search | string | The YouSign search parameters. This can be the email of the person who signed, the filename... Example : [email protected] - will download all the files in a signature process with [email protected] | | absoluteOutFolderPath | string | An absolute path to the output folder for the downloaded files (without trailing /) Example : /Users/joe/out - the folder MUST already exist and be writeable |

listSignatures(email)

Lists the existing signatures and the corresponding statuses for an email

Kind: global function

| Param | Type | Description | | --- | --- | --- | | email | string | Email of the person whose signatures we want to get |