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

@ignisign/js

v4.1.0

Published

This library facilitates the integration of the Ignisign electronic signature into web-based applications using the `embedded` mode.

Downloads

499

Readme

Integrating Ignisign Signature in Web Applications

This library facilitates the integration of the Ignisign electronic signature into web-based applications using the embedded mode.

Alternatively, Ignisign can be integrated in a by side mode, where users are redirected to the Ignisign platform to sign documents via an email link, with Ignisign managing the entire process.

For detailed information on these integration modes, visit Embedded or By-Side Integration.

If you are looking for the NodeJS Backend library, it is available here.

Installation

Install the library using npm:

npm install @ignisign/ignisign-js

An Ignisign account is required, which can be created for free at Ignisign Sign Up.

Examples

Find integration examples here.

Usage

Initializing IgnisignJs Class

To use IgnisignJs, first initialize the class. You will need an appId and an application environment:

import { IgnisignJs } from "@ignisign/ignisign-js"

const ignisignJs = new IgnisignJs(appId, appEnv);

Find your appId and appEnv in the "API Keys" section of the Ignisign Console. The application environment is defined as:

enum IGNISIGN_APPLICATION_ENV {
  DEVELOPMENT = "DEVELOPMENT",
  STAGING = "STAGING",
  PRODUCTION = "PRODUCTION",
}

Initializing a Signature Session

To start a signature session, use the initSignatureSession method of your ignisignJs instance:

Error Handling

Implement handleSignatureSessionError to manage errors:

const handleSignatureSessionError = async (
    errorCode, errorContext, signerId, signatureRequestId
  ) : Promise<void> => {
    // Error handling logic here
  }

handleSignatureSessionError Params

  • errorCode: The error code
  • errorContext: A context that will help you to understand from where the error comes from
  • signerId : The id of the signer
  • signatureRequestId : The id of the signature request

Finalizing Signatures

For handling the completion of signatures, use handleSignatureSessionFinalized:

const handleSignatureSessionFinalized = async (
    signatureIds, signerId, signatureRequestId
  ) : Promise<void> => {
    // Finalization logic here
  }

handleSignatureSessionFinalized params

  • signatureIds : The ids of the signatures
  • signerId : The id of the signer
  • signatureRequestId: The id of the signature requ

Managing Private File Information

For private file info provisioning, implement handlePrivateFileInfoProvisioning:

const handlePrivateFileInfoProvisioning = async (
    documentId, externalDocumentId, signerId, signatureRequestId
  ): Promise<IgnisignDocument_PrivateFileDto> => {
    // Logic to retrieve private file information
  }

handlePrivateFileInfoProvisioning params

  • documentId : The id of the document to sign
  • externalDocumentId : An reference that refers to the document to sign into your application - You have to provide it when you provide the document to Ignisign
  • signerId : The id of the signer
  • signatureRequestId : The id of the signature request

IgnisignPrivateFileDto fields

  • fileUrl : The url of the file to sign
  • mimeType : The mime type of the file to sign
  • fileName : The name of the file to sign
  • bearer : Optional - A bearer token to access the file - if provided, the bearer token will be placed into the Authorization header of the request

Signature Session Initialization Parameters

Define the initialization parameters for the signature session:

const initParams: IgnisignJS_SignatureSession_Initialization_Params = {
  htmlElementId          : "my-div-signature-request-request-id",
  signatureRequestId     : "6490205421ac2fXXXXX" ,
  signerId               : "6490205421ac2fXXXXX",
  signatureSessionToken  : "6490205421ac2fXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  signerAuthSecret       : "6490205421ac2fXXXXX" , 
  closeOnFinish          : true,
  sessionCallbacks : {
    handleSignatureRequestError,
    handleSignatureRequestFinalized,
    handlePrivateFileInfoProvisioning,
  }
  dimensions : {
    width: "100%",
    height: "500px",
  },
  displayOptions : {
    showTitle                     : false,
    showDescription               : false,
    darkMode                      : false,
    forceShowDocumentInformations : false
  }
}

await ignisignJs.initSignatureSession(initParams);

IgnisignJS_SignatureRequest_Initialization_Params fields informations

  • htmlElementId : The id of the html element that will contain the signature request iframe
  • signatureRequestId : The id of the signature request - this value is provided to your backend by webhook when the signature request is created
  • signerId : The id of the signer - this value is provided to your backend by webhook when the signature request is created
  • signatureSessionToken : The unique token that allows you to access to the signature request for the signer - This value is provided to your backend by webhook when the signature request is created
  • signerAuthSecret : The secret that allows you to authenticate the signer - This value is provided to your backend by webhook when the signer is created
  • closeOnFinish : OPTIONAL - default true - If true, the signature request iframe will be closed automatically in case of finalization or error
  • sessionCallbacks : OPTIONAL The callbacks that will be called when the signature request iframe send a message to the parent window
  • sessionCallbacks.handlePrivateFileInfoProvisioning :OPTIONAL - This method must be implemented if the signature profile linked to the signature request is configured to use a private files. If you want to close automatically the signature request iframe when the signature request is finalized, you can set the closeOnFinish parameter to true when you call the initSignatureRequest method
  • sessionCallbacks.handleSignatureRequestError : RECOMMENDED - This method must be implemented if you want to handle the signature request errors.
  • sessionCallbacks.handleSignatureRequestFinalized : RECOMMENDED - This method must be implemented if you want to handle the signature request finalization.
  • dimensions : OPTIONAL - The options that will be used to configure the signature request iframe
  • dimensions.width : default: "100%"
  • dimensions.height : default "500px"
  • displayOptions : OPTIONAL - Option taht determinate the content displayed into the signing interface
  • displayOptions.showTitle : default: false - Show the title of the signature request like in by-side mode
  • displayOptions.showDescription : default: false - Show the description of the signature request like in by-side mode
  • displayOptions.darkMode : default : "Browser" force the darkMode of the content.
  • displayOptions.forceShowDocumentInformations : default : false

Refer to the Ignisign documentation for detailed parameter descriptions and additional guidance:

Canceling a Signature Session

To prematurely close a signature session, call cancelSignatureSession on your ignisignJs instance:

ignisignJs.cancelSignatureSession();