{"_id":"shuftipro-web-sdk","_rev":"55-68b38932169356fcd6ae1d55b39178ac","name":"shuftipro-web-sdk","dist-tags":{"latest":"0.0.36"},"versions":{"0.0.29":{"name":"shuftipro-web-sdk","version":"0.0.29","keywords":["ShuftiPro"],"author":{"name":"ShuftiPro"},"license":"MIT","_id":"shuftipro-web-sdk@0.0.29","maintainers":[{"name":"shuftiprosdk","email":"tech@shuftipro.com"}],"homepage":"https://developers.shuftipro.com/","dist":{"shasum":"c66fa31e7c58985893ff771ca8f7ce1044c017d0","tarball":"https://registry.npmjs.org/shuftipro-web-sdk/-/shuftipro-web-sdk-0.0.29.tgz","fileCount":6,"integrity":"sha512-/eFVjNaAt3ADQzgIiwz3XSP1STKbeEvElplFOcjkeDxJ6NSUjwV+SXTbv0ecq115rR2l3zSe38YntItwIkRr1g==","signatures":[{"sig":"MEYCIQC40Zi+zw5sXzD6ieKDD2b9yMizSjNnBbksBNx3bqUXRAIhAKOlsdWpelWWmnX90G4r5Js0fPleH2gIOXyGTX2CYFKw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144847},"main":"./dist/npm/index.js","gitHead":"a6a9ad32983245b07c62b7c80bf3896eef39869b","scripts":{"build":"webpack --config webpack.config.js","build:cdn":"webpack --config webpack.config.js --env target=cdn","build:npm":"webpack --config webpack.config.js --env target=npm"},"_npmUser":{"name":"shuftiprosdk","email":"tech@shuftipro.com"},"repository":{"url":"https://developers.shuftipro.com/"},"_npmVersion":"8.19.4","description":"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","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.91.0","@babel/core":"^7.24.5","webpack-cli":"^5.1.4","babel-loader":"^9.1.3","@babel/preset-env":"^7.24.5"},"_npmOperationalInternal":{"tmp":"tmp/shuftipro-web-sdk_0.0.29_1721303015847_0.7427927593133863","host":"s3://npm-registry-packages"}},"0.0.32":{"name":"shuftipro-web-sdk","version":"0.0.32","keywords":["ShuftiPro"],"author":{"name":"ShuftiPro"},"license":"MIT","_id":"shuftipro-web-sdk@0.0.32","maintainers":[{"name":"shuftiprosdk","email":"tech@shuftipro.com"}],"homepage":"https://developers.shuftipro.com/","dist":{"shasum":"28b0b78666ad87b807fad57cd79e01f731245bdb","tarball":"https://registry.npmjs.org/shuftipro-web-sdk/-/shuftipro-web-sdk-0.0.32.tgz","fileCount":6,"integrity":"sha512-FL9xt0gYww/jvt6u01Ydv2pYRCR5SExtL3W1aGuwMFg8DECYDS7kUaDQF4+WlUNopfxIN46m8MYHkgZJ1Np0nQ==","signatures":[{"sig":"MEQCIEkvnyRc39htHfXD5hjtTQEEUsofOYhyWYl6B/v0NNh1AiBiZWHs6s04LKuDTvby5la8NLOmAsmlVIhHn9CA0BkJ8g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145950},"main":"./dist/npm/index.js","gitHead":"a6a9ad32983245b07c62b7c80bf3896eef39869b","scripts":{"build":"webpack --config webpack.config.js","build:cdn":"webpack --config webpack.config.js --env target=cdn","build:npm":"webpack --config webpack.config.js --env target=npm"},"_npmUser":{"name":"shuftiprosdk","email":"tech@shuftipro.com"},"repository":{"url":"https://developers.shuftipro.com/"},"_npmVersion":"8.19.4","description":"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","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.91.0","@babel/core":"^7.24.5","webpack-cli":"^5.1.4","babel-loader":"^9.1.3","@babel/preset-env":"^7.24.5"},"_npmOperationalInternal":{"tmp":"tmp/shuftipro-web-sdk_0.0.32_1721394957136_0.5282323195725016","host":"s3://npm-registry-packages"}},"0.0.34":{"name":"shuftipro-web-sdk","version":"0.0.34","keywords":["ShuftiPro"],"author":{"name":"ShuftiPro"},"license":"MIT","_id":"shuftipro-web-sdk@0.0.34","maintainers":[{"name":"shuftiprosdk","email":"tech@shuftipro.com"}],"homepage":"https://developers.shuftipro.com/","dist":{"shasum":"ecbdf3c6f43229de0791daf122e3fe5605d885eb","tarball":"https://registry.npmjs.org/shuftipro-web-sdk/-/shuftipro-web-sdk-0.0.34.tgz","fileCount":6,"integrity":"sha512-xp8yJ9V/B0MIxzr3Twbm8no/qpoBE5A30Ukotpo3X7zRbg5xezCGcLNF01W92yb0f0cBYL/pcYbOr8K6kT6eYA==","signatures":[{"sig":"MEUCIQDKOjXvxL6NqYOCoTljhfCE2A+s9GAWSUFJ/Z42k8RTjQIgbB+f+TjEVyDE7Z30P+6QZhUxH0EANupv1F7E7XKLhk0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147104},"main":"./dist/npm/index.js","gitHead":"a6a9ad32983245b07c62b7c80bf3896eef39869b","scripts":{"build":"webpack --config webpack.config.js","build:cdn":"webpack --config webpack.config.js --env target=cdn","build:npm":"webpack --config webpack.config.js --env target=npm"},"_npmUser":{"name":"shuftiprosdk","email":"tech@shuftipro.com"},"repository":{"url":"https://developers.shuftipro.com/"},"_npmVersion":"8.19.4","description":"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","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.91.0","@babel/core":"^7.24.5","webpack-cli":"^5.1.4","babel-loader":"^9.1.3","@babel/preset-env":"^7.24.5"},"_npmOperationalInternal":{"tmp":"tmp/shuftipro-web-sdk_0.0.34_1721650315881_0.9762479978540941","host":"s3://npm-registry-packages"}},"0.0.34-internal.2":{"name":"shuftipro-web-sdk","version":"0.0.34-internal.2","keywords":["ShuftiPro"],"author":{"name":"ShuftiPro"},"license":"MIT","_id":"shuftipro-web-sdk@0.0.34-internal.2","maintainers":[{"name":"shuftiprosdk","email":"tech@shuftipro.com"}],"homepage":"https://developers.shuftipro.com/","dist":{"shasum":"4714bac8c0b6ff87fe5bf06c0cd96c9afcf32c13","tarball":"https://registry.npmjs.org/shuftipro-web-sdk/-/shuftipro-web-sdk-0.0.34-internal.2.tgz","fileCount":6,"integrity":"sha512-Tn+Tb6HLzoiFqj7Txv/6IhJF9IeIjMwGo3UgLBmiRnillLzwxaHK+W1TOGgsYLtpSMofbEQzlYwMJr2YWzmL/g==","signatures":[{"sig":"MEUCIQCZlu+fYzWYGdl5PL2Mb3EjUe/YVshxE2xc4VkYpBkVwgIgA2G6U35tRNVo/3urdb/BO8my/ftDP2bgbi/KourB61Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189211},"main":"./dist/npm/index.js","gitHead":"1a2236f2ebe03ff2060977373f00fa512b5972f5","scripts":{"build":"webpack --config webpack.config.js","build:cdn":"webpack --config webpack.config.js --env target=cdn","build:npm":"webpack --config webpack.config.js --env target=npm"},"_npmUser":{"name":"shuftiprosdk","email":"tech@shuftipro.com"},"repository":{"url":"https://developers.shuftipro.com/"},"_npmVersion":"8.19.4","description":"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","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.91.0","@babel/core":"^7.24.5","webpack-cli":"^5.1.4","babel-loader":"^9.1.3","@babel/preset-env":"^7.24.5"},"_npmOperationalInternal":{"tmp":"tmp/shuftipro-web-sdk_0.0.34-internal.2_1721916430894_0.35849896474363097","host":"s3://npm-registry-packages"}},"0.0.35":{"name":"shuftipro-web-sdk","version":"0.0.35","keywords":["ShuftiPro"],"author":{"name":"ShuftiPro"},"license":"MIT","_id":"shuftipro-web-sdk@0.0.35","maintainers":[{"name":"shuftiprosdk","email":"tech@shuftipro.com"}],"homepage":"https://developers.shuftipro.com/","dist":{"shasum":"f2a5f32cb4827df9e0625745d032413676e99fb8","tarball":"https://registry.npmjs.org/shuftipro-web-sdk/-/shuftipro-web-sdk-0.0.35.tgz","fileCount":6,"integrity":"sha512-sx65KNUfk/G6IqPahTofucQ8NPmb/BSWeIrIeuPGdwwdJQhLhzuR2t2xdR7HkySJOzj4pGnxGK7v1JlUEPyPPg==","signatures":[{"sig":"MEUCIAO5JEinBrnVY6KAe6xGc7SxAMTmucQdhuQJyGdRKfblAiEA1O5n4ul11OCVwsx1PG3cdc4+gulEqDrMHCsS6gY4qg8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":189196},"main":"./dist/npm/index.js","gitHead":"1a2236f2ebe03ff2060977373f00fa512b5972f5","scripts":{"build":"webpack --config webpack.config.js","build:cdn":"webpack --config webpack.config.js --env target=cdn","build:npm":"webpack --config webpack.config.js --env target=npm"},"_npmUser":{"name":"shuftiprosdk","email":"tech@shuftipro.com"},"repository":{"url":"https://developers.shuftipro.com/"},"_npmVersion":"8.19.4","description":"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","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.91.0","@babel/core":"^7.24.5","webpack-cli":"^5.1.4","babel-loader":"^9.1.3","@babel/preset-env":"^7.24.5"},"_npmOperationalInternal":{"tmp":"tmp/shuftipro-web-sdk_0.0.35_1722585776772_0.4273813194761853","host":"s3://npm-registry-packages"}},"0.0.36":{"name":"shuftipro-web-sdk","version":"0.0.36","description":"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","main":"./dist/npm/index.js","homepage":"https://developers.shuftipro.com/docs/websdk/intro","repository":{"url":"https://developers.shuftipro.com/docs/websdk/intro"},"scripts":{"build":"webpack --config webpack.config.js","build:cdn":"webpack --config webpack.config.js --env target=cdn","build:npm":"webpack --config webpack.config.js --env target=npm"},"keywords":["ShuftiPro"],"author":{"name":"ShuftiPro"},"license":"MIT","devDependencies":{"webpack":"^5.91.0","webpack-cli":"^5.1.4","@babel/core":"^7.24.5","@babel/preset-env":"^7.24.5","babel-loader":"^9.1.3"},"gitHead":"44cbe031192915e8aa300ecffe6565ca5eb4edbd","_id":"shuftipro-web-sdk@0.0.36","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-V7yrmpu0yf7T94m0kdKvUyavUr0X9gcoxPWAtkiFcxxY7/t3B/LtQhM+V4HB571c2KKmbnTT3dColwpzfC0pOA==","shasum":"1a563ec5805ca9eb3d728315055b0f42fbf7a2f5","tarball":"https://registry.npmjs.org/shuftipro-web-sdk/-/shuftipro-web-sdk-0.0.36.tgz","fileCount":6,"unpackedSize":188771,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFC5vIeAgbzSXSVyvz6nRt7ZAOmjkQRs+z5jP3fSpi9hAiEAmchIgT9NIimeDmPCe74JebSFpSx2PukFYq6NY6b+1Jc="}]},"_npmUser":{"name":"shuftiprosdk","email":"tech@shuftipro.com"},"directories":{},"maintainers":[{"name":"shuftiprosdk","email":"tech@shuftipro.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/shuftipro-web-sdk_0.0.36_1724243403530_0.5504381464677099"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-21T09:13:34.835Z","modified":"2024-08-21T12:30:04.028Z","1.0.0":"2024-05-21T09:13:35.035Z","1.0.9":"2024-05-21T09:19:44.926Z","0.0.10":"2024-05-21T09:41:47.711Z","0.0.11":"2024-05-21T09:43:46.760Z","0.0.12":"2024-05-21T09:59:29.937Z","0.0.13":"2024-05-21T10:06:08.539Z","0.0.14":"2024-05-21T10:11:15.065Z","0.0.15":"2024-05-21T10:12:10.873Z","0.0.16":"2024-05-21T10:36:09.718Z","0.0.17":"2024-05-21T10:36:57.370Z","0.0.18":"2024-05-21T10:47:25.596Z","0.0.19":"2024-05-21T10:55:35.123Z","0.0.20":"2024-05-21T11:00:55.396Z","0.0.21":"2024-05-21T11:03:48.962Z","0.0.22":"2024-05-21T12:25:19.613Z","0.0.23":"2024-05-21T12:26:44.257Z","0.0.24":"2024-05-22T06:55:51.573Z","0.0.25":"2024-05-22T11:48:18.985Z","0.0.26":"2024-05-22T11:51:02.664Z","0.0.27":"2024-07-03T07:45:21.093Z","0.0.28":"2024-07-12T12:05:22.937Z","0.0.29":"2024-07-18T11:43:36.012Z","0.0.30":"2024-07-19T12:06:27.172Z","0.0.31":"2024-07-19T12:35:41.962Z","0.0.32":"2024-07-19T13:15:57.356Z","0.0.33":"2024-07-22T09:28:59.647Z","0.0.34":"2024-07-22T12:11:56.021Z","0.0.34-internal.1":"2024-07-25T08:13:37.772Z","0.0.34-internal.2":"2024-07-25T14:07:11.083Z","0.0.35":"2024-08-02T08:02:56.964Z","0.0.36":"2024-08-21T12:30:03.838Z"},"author":{"name":"ShuftiPro"},"license":"MIT","homepage":"https://developers.shuftipro.com/docs/websdk/intro","keywords":["ShuftiPro"],"repository":{"url":"https://developers.shuftipro.com/docs/websdk/intro"},"description":"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","maintainers":[{"name":"shuftiprosdk","email":"tech@shuftipro.com"}],"readme":"# ShuftiPro JavaScript SDK\n\n## Table of Contents\n\n- [1. Introduction](#1-introduction)\n- [2. Overview](#2-overview)\n- [3. Installation](#3-installation)\n  - [3.1. Directly from CDN](#31-directly-from-cdn)\n  - [3.2. NPM Installation](#32-npm-installation)\n- [4. Usage](#4-usage)\n  - [4.1. Add basic HTML markup](#41-add-basic-html-markup)\n  - [4.2. Initialization](#42-initialization)\n    - [4.2.1 Using customer ID](#421-using-customer-id)\n  - [4.3. Handling Events](#43-handling-events)\n  - [4.4. Fetching Request Status](#44-fetching-request-status)\n  - [4.5. Destroy SDK Instance](#45-destroy-sdk-instance)\n  - [4.6. Multiple Instances](#46-multiple-instances)\n<!-- - [5. Project Structure](#5-project-structure) -->\n\n## 1. `Introduction`\n\nThe 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.\n\n## 2. `Overview`\n\nThe 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.\n\n## 3. `Installation`\n\nWe can include the SDK in our web project by directly referencing it from a CDN or by using npm package.\n\n### 3.1. Directly from CDN\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/shuftipro-web-sdk/dist/cdn/shuftipro-web-sdk.js\"></script>\n```\n\n### 3.2. NPM Installation\n\nIf you prefer to use the npm package, you can install it via npm or yarn:\n\n```bash\nnpm install shuftipro-web-sdk\n```\n\nAfter installing, you can import and use the SDK in your JavaScript files:\n\n```javascript\nimport ShuftiPro from 'shuftipro-web-sdk';\n\n// Initialize the ShuftiPro SDK\nconst shuftiPro = new ShuftiPro();\nshuftiPro.init({\n    client_id: 'YOUR_CLIENT_ID',\n    customer_id: 'YOUR_CUSTOMER_ID',\n}).start();\n```\n\n## 4. `Usage`\n\n### 4.1. Add basic HTML markup\n\nAdd an empty HTML element at the bottom of your page for the modal interface to mount itself on.\n\n```html\n<div id=\"verification-container\"></div>\n```\n\n### 4.2. Initialization\n\nTo initialize the SDK, create a new instance of `ShuftiPro` and call the `init` method with initial data:\n\n#### 4.2.1 Using customer ID\n\n```javascript\nconst shuftiPro = new ShuftiPro();\nshuftiPro.init({\n    client_id: 'YOUR_CLIENT_ID',\n    customer_id: 'YOUR_CUSTOMER_ID',\n    containerId: 'verification-container' //or iframeId\n}).start();\n```\n\n| Parameter     | Format           | Notes                                                                                                                                                                                                                                                                                                                                            |\n| ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `client_id`       | string           | **required** <br /> Your Shufti Pro client ID.                                                                                                                                                                                                                                                                                                            |\n| `customer_id`       | string           | **required** <br /> Your Customer ID.                                                                                                                                                                                                                                                                                                            |\n| `containerId` | string           | **optional** <br />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`. <br /> 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 |\n<hr />\n\n### 4.3. Handling Events\n\nWe can listen for verification events using the `on` method. Here's how we can handle the 'shuftiResponse' event:\n\n```javascript\nshuftiPro.on('shuftiResponse', (response) => {\n    console.log('Verification response:', response);\n});\n```\n\nAlternatively, we can listen for verification events using callback. Here's how we can handle the 'callback' event.\n\n```javascript\nshuftiPro.start(callbackFunction);\n```\n\n### 4.4. Fetching Request Status\n\nTo 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:\n\n```javascript\nshuftiPro.fetchRequestStatus('REFERENCE_ID', (response) => {\n    console.log('Verification status:', response);\n});\n```\n\n| Parameter     | Format           | Notes                                                                                                                                                                                                                                                                                                                                            |\n| ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `reference`       | string           |  **required** <br /> Pass the reference ID of the request |\n| `callback`       | string           |  **required** <br /> A callback function to handle the status                                                                                                                                                                                                                                                                                                                                            |\n<hr />\n\nThis 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.\n\n### 4.5. Destroy SDK Instance\n\nTo clean up and destroy the SDK instance, call the `destroy` method:\n\n```javascript\nshuftiPro.destroy();\n```\n\n### 4.6. Multiple Instances\n\nWe 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:\n\n```javascript\n// First instance\nconst shuftiProInstance1 = new ShuftiPro();\nshuftiProInstance1.setToken(token1)\n    .init({\n        payload: payload1,\n        containerId: 'verification-container1' // or frameId\n    })\n    .start(callback1);\n\n// Second instance\nconst shuftiProInstance2 = new ShuftiPro();\nshuftiProInstance2.setToken(token2)\n    .init({\n        payload: payload2,\n        containerId: 'verification-container2' // or frameId\n    })\n    .start(callback2);\n\n// Additional instances can be similarly created and managed\n```\n\nBy 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.\n","readmeFilename":"readme.md"}