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 🙏

© 2026 – Pkg Stats / Ryan Hefner

shuftipro-web-sdk

v0.0.36

Published

The purpose of ShuftiPro Web SDK is to streamline the integration process of Shufti Pro's verification services within web applications. It aims to simplify and automate various aspects of verification, including SDK initialization, authentication token m

Readme

ShuftiPro JavaScript SDK

Table of Contents

1. Introduction

The ShuftiPro JavaScript SDK provides comprehensive functionalities for integrating Shufti Pro verification services into web applications. Developers can easily initialize the SDK by providing client Id and customer Id, facilitating seamless integration of verification processes and event handling.

2. Overview

The purpose of the ShuftiPro Web SDK is to streamline the integration process of Shufti Pro's verification services within web applications. It simplifies and automates various aspects of verification, including SDK initialization using either authentication tokens or client Id and customer Id, verification process initiation, and event handling. By offering a comprehensive set of functionalities, the Web SDK empowers developers to seamlessly incorporate Shufti Pro's verification capabilities into their web applications, enhancing user experience and security.

3. Installation

We can include the SDK in our web project by directly referencing it from a CDN or by using npm package.

3.1. Directly from CDN

<script src="https://cdn.jsdelivr.net/npm/shuftipro-web-sdk/dist/cdn/shuftipro-web-sdk.js"></script>

3.2. NPM Installation

If you prefer to use the npm package, you can install it via npm or yarn:

npm install shuftipro-web-sdk

After installing, you can import and use the SDK in your JavaScript files:

import ShuftiPro from 'shuftipro-web-sdk';

// Initialize the ShuftiPro SDK
const shuftiPro = new ShuftiPro();
shuftiPro.init({
    client_id: 'YOUR_CLIENT_ID',
    customer_id: 'YOUR_CUSTOMER_ID',
}).start();

4. Usage

4.1. Add basic HTML markup

Add an empty HTML element at the bottom of your page for the modal interface to mount itself on.

<div id="verification-container"></div>

4.2. Initialization

To initialize the SDK, create a new instance of ShuftiPro and call the init method with initial data:

4.2.1 Using customer ID

const shuftiPro = new ShuftiPro();
shuftiPro.init({
    client_id: 'YOUR_CLIENT_ID',
    customer_id: 'YOUR_CUSTOMER_ID',
    containerId: 'verification-container' //or iframeId
}).start();

| Parameter | Format | Notes | | ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | client_id | string | required Your Shufti Pro client ID. | | customer_id | string | required Your Customer ID. | | containerId | string | optional A string containing the ID of the container element that the UI will mount to. This must be an empty element. The default is shuftipro-websdk-iframe. Alternatively, if your integration requires it, you can pass in the container element instead. Note that if iframeId is provided, then containerId will be ignored. if both are not provided then iframe will be opened in popup |

4.3. Handling Events

We can listen for verification events using the on method. Here's how we can handle the 'shuftiResponse' event:

shuftiPro.on('shuftiResponse', (response) => {
    console.log('Verification response:', response);
});

Alternatively, we can listen for verification events using callback. Here's how we can handle the 'callback' event.

shuftiPro.start(callbackFunction);

4.4. Fetching Request Status

To fetch the status of a verification request, use the fetchRequestStatus method. Pass the reference ID of the request along with a callback function to handle the status response:

shuftiPro.fetchRequestStatus('REFERENCE_ID', (response) => {
    console.log('Verification status:', response);
});

| Parameter | Format | Notes | | ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | reference | string | required Pass the reference ID of the request | | callback | string | required A callback function to handle the status |

This method allows us to query the status of a verification request by providing its unique reference ID. Upon receiving the status response, we can handle it accordingly within the provided callback function.

4.5. Destroy SDK Instance

To clean up and destroy the SDK instance, call the destroy method:

shuftiPro.destroy();

4.6. Multiple Instances

We can create and manage multiple instances of the SDK to handle various verification processes simultaneously. Each instance can be independently configured and initiated, allowing for efficient management of multiple verification tasks:

// First instance
const shuftiProInstance1 = new ShuftiPro();
shuftiProInstance1.setToken(token1)
    .init({
        payload: payload1,
        containerId: 'verification-container1' // or frameId
    })
    .start(callback1);

// Second instance
const shuftiProInstance2 = new ShuftiPro();
shuftiProInstance2.setToken(token2)
    .init({
        payload: payload2,
        containerId: 'verification-container2' // or frameId
    })
    .start(callback2);

// Additional instances can be similarly created and managed

By creating multiple instances, we can efficiently handle concurrent verification processes within our application. Each instance operates independently, allowing for parallel execution of verification tasks and enhancing overall performance.