{"analyzedAt":"2022-11-17T10:30:28.005Z","collected":{"metadata":{"name":"youverify-web-sdk","scope":"unscoped","version":"1.0.18","description":"A web SDK for Youverify","keywords":["vform","youverify","youverify os","youverify-browser-sdk","liveness","liveness test","liveness check","document","document capture","document scanning","yvos","sdk"],"date":"2022-11-16T07:51:39.140Z","author":{"name":"Youverify Devs"},"publisher":{"username":"youverify-hq","email":"developer@youverify.co"},"maintainers":[{"username":"youverify-hq","email":"developer@youverify.co"}],"links":{"npm":"https://www.npmjs.com/package/youverify-web-sdk"},"license":"MIT","devDependencies":{"@babel/cli":"^7.16.0","@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","eslint":"^8.5.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-prettier":"^4.0.0","prettier":"^2.5.1","uglify-js":"^3.15.2","webpack":"^5.66.0","webpack-cli":"^4.9.1"},"releases":[{"from":"2022-10-18T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":4},{"from":"2022-08-19T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":7},{"from":"2022-05-21T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":15},{"from":"2021-11-17T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":18},{"from":"2020-11-17T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":18}],"hasSelectiveFiles":true,"readme":"# Youverify Web SDK\n\n> Browser wrapper for [Youverify's](https://youverify.co) vForm\n\n# Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Modules](#modules)\n  - [vForm](#vform)\n  - [Liveness Check](#liveness-check)\n  - [Document Capture](#document-capture)\n- [Options](#options)\n  - [vForm](#vform-options)\n  - [Liveness Check](#liveness-check-options)\n  - [Document Capture](#document-capture-options)\n\n## Features\n\n## Installation\n\n**Using npm:**\n\n```sh\n$ npm install youverify-web-sdk\n```\n\n**Using yarn:**\n\n```sh\n$ yarn add youverify-web-sdk\n```\n\n**Using CDN:**\n\n## Modules\n\n### vForm\n\nThe vForm module is available for integration to your web app if you wish\nto use vForm\n\n#### Usage\n\n**Initialization:**\n\n1. To use the vForm module in your project, you have to first pass your custom options to it like so:\n\n```sh\nconst vFormModule = new YouverifySDK.vForm(options)\n```\n\n> Checkout a list of the [valid options for the vForm module](#vform-options)\n\nExample:\n\n```javascript\nconst vFormModule = new YouverifySDK.vForm({\n\tvFormId: `Id of vForm`,\n\tpublicMerchantKey: `<YOUR PUBLIC MERCHANT KEY>`,\n  \n    // true if environment is in development mode.\n    dev:boolean,\n  \n\tpersonalInformation: {\n\t\tfirstName: \"John\",\n\t\tlastName: \"Doe\",\n\t},\n\tmetadata: {},\n\tonSuccess: () => {\n\t\t// vForm has submitted successfully\n\t},\n\tonClose: () => {\n\t\t// close button was clicked\n\t},\n});\n```\n\n2. Call initialize on the `vFormModule` object\n\n```javascript\ntry {\n\tvFormModule.initialize();\n} catch (error) {\n\t// handle validation error\n}\n```\n\n**Start Process**\n\n3. Call `start()` on the `vFormModule` object to show the pop-up modal and start the process.\n\n```javascript\nvFormModule.start();\n```\n\n> Note: Once the vForm process is completed and successfull, the `onCompleted` callback supplied will be triggered. If none was supplied, nothing happens.\n\n### Liveness Check\n\nThe Liveness Check module is available for integration to your web app if you wish to allow your users perform liveness checks.\n\n#### Usage\n\n**Initialization:**\n\n1. To use the liveness module in your project, you have to first pass your custom options to it like so:\n\n```sh\nconst livenessCheckModule = new YouverifySDK.liveness(options)\n```\n\n> Checkout a list of the [valid options for the liveness check module](#liveness-check-options)\n\nExample:\n\n```javascript\nconst livenessCheckModule = new YouverifySDK.liveness({\n\tpublicMerchantKey: `<YOUR PUBLIC MERCHANT KEY>`,\n\n    // true if environment is in development mode.\n    dev:boolean,\n  \n\tpersonalInformation: {\n\t\tfirstName: \"John\",\n\t},\n\tonSuccess: () => {\n\t\t// liveness check was successful\n\t},\n\tonFailure: () => {\n\t\t// liveness check was not successful\n\t},\n});\n```\n\n2. Call initialize on the `livenessCheckModule` object\n\n```javascript\ntry {\n\tlivenessCheckModule.initialize();\n} catch (error) {\n\t// handle validation error\n}\n```\n\n**Start Process**\n\n3. Call `start()` on the `livenessCheckModule` object to show the pop-up modal and start the process.\n\n```javascript\nlivenessCheckModule.start();\n```\n\n> Note: Once the liveness process is completed and successfull, the `onSuccess` callback supplied will be triggered. If none was supplied, nothing happens.\n\n### Document Capture\n\nThe Document Capture module is available for integration to your web app if you wish to allow your users carry out identity documents capture.\n\n#### Usage\n\n**Initialization:**\n\n1. To use the document capture module in your project, you have to first pass your custom options to it like so:\n\n```sh\nconst documentCaptureModule = new YouverifySDK.documentCapture(options)\n```\n\n> Checkout a list of the [valid options for the document capture module](#document-capture-options)\n\nExample:\n\n```javascript\nconst documentCaptureModule = new YouverifySDK.documentCapture({\n\tpublicMerchantKey: `<YOUR PUBLIC MERCHANT KEY>`,\n  personalInformation: {\n    firstName: \"John\",\n  },\n  \n    // true if environment is in development mode.\n    dev:boolean,\n    \n  //pass country you want the document to be capture for. (optional)\n    country:\"Canada\",\n  \n  // pass the province in the country you entered above. (optional) leave blank if country does not have a province\n  province:'Ontario',\n  \n  //list of document types you want in the country. (optional)\n  //for list of supported countries,province and document types see here\n  idTypes:[\"Passport\", \"Residence Permit\", \"Tribal ID\"],\n  \n\tonSuccess: () => {\n\t\t// result received from document\n\t},\n\tonFailure: () => {\n\t\t// could not get result from document\n\t},\n});\n```\n\n2. Call initialize on the `documentCaptureModule` object\n\n```javascript\ntry {\n\tdocumentCaptureModule.initialize();\n} catch (error) {\n\t// handle validation error\n}\n```\n\n**Start Process**\n\n3. Call `start()` on the `documentCaptureModule` object to show the pop-up modal and start the process.\n\n```javascript\ndocumentCaptureModule.start();\n```\n\n> Note: Once the document capture process is completed and successfull, the `onSuccess` callback supplied will be triggered. If none was supplied, nothing happens.\n\n## Options\n\n### vForm Options\n\nThese are the valid options to pass to the `vFormModule` instance\n\n```javascript\n{\n  // `vFormId` is the Id of the vForm you would like the SDK to open\n  \"vFormId\": \"<YOUR-VFORM-ID>\", // required\n\n  // `publicMerchantKey` is available in your YVOS profile\n  \"publicMerchantKey\": \"<YOUR-PUBLIC-MERCHANT-KEY>\", // required\n          \n  // true if environment is in development mode.        \n  \"dev\":boolean,\n\n  // `personalInformation` is an object containing a list of predefined user attributes to be passed to the SDK for personalization of the experience. Attributes passed here should typically exist in the vForm created, else, they will be ignored.\n  \"personalInformation\": {\n    \"firstName\": \"John\", // optional\n    \"lastName\": \"Doe\", // optional\n    \"middleName\": \"Bruno\", // optional\n    \"email\": \"john@doe.co\", // optional\n    \"mobile\": \"+2348*********\", // optional\n    \"gender\": \"MALE\", // optional [MALE, FEMALE or NOT_IDENTIFIED]\n  },\n\n  // `metadata` is any other information you would like to pass to your webhook URL\n  \"metadata\": { // optional\n    // your custom keys\n  },\n\n  // `onComplete` callback is a function called onced the vForm entry has been submitted and process completed successfully\n  \"onComplete\": () => { // optional\n    // custom logic here\n  }\n\n  // `onSuccess` callback is a function called onced the vForm entry has been submitted successfully\n  \"onSuccess\": (data) => { // optional\n    // custom logic here\n  }\n\n  // `onFailure` callback is a function called onced the vForm entry submission fails due to some reasons\n  \"onFailure\": (error) => { // optional\n    // custom logic here\n  }\n\n  // `onClose` callback is a function called onced the vForm process has been cancelled or modal closed\n  \"onClose\": () => { // optional\n    // custom logic here\n  }\n}\n```\n\n### Liveness Check Options\n\nThese are the valid options to pass to the `livenessCheckModule` instance\n\n```javascript\n{\n  // `publicMerchantKey` is available in your YVOS profile\n  \"publicMerchantKey\": \"<YOUR-PUBLIC-MERCHANT-KEY>\", // required\n          \n    // true if environment is in development mode.\n   \"dev\":boolean,\n          \n          \n  // `personalInformation` is an object containing a list of predefined user attributes to be passed to the SDK for personalization of the experience\n  \"personalInformation\": {\n    \"firstName\": \"John\", // optional\n  },\n\n  // `metadata` is any other information you would like to pass to your webhook URL\n  \"metadata\": { // optional\n    // your custom keys\n  },\n\n  // `onCompleted` callback is a function called onced the liveness check was successful\n  \"onSuccess\": () => { // optional\n    // custom logic here\n  }\n\n  // `onRetry` callback is a function called onced the liveness process failed and is being retried\n  \"onRetry\": (data) => { // optional\n    // custom logic here\n  }\n\n  // `onCancel` callback is a function called onced the liveness process is cancelled\n  \"onCancel\": (data) => { // optional\n    // custom logic here\n  }\n\n  // `onFailure` callback is a function called onced the liveness check fails\n  \"onFailure\": (error) => { // optional\n    // custom logic here\n  }\n\n  // `onClose` callback is a function called onced the liveness check process modal has been closed\n  \"onClose\": () => { // optional\n    // custom logic here\n  }\n}\n```\n\n### Document Capture Options\n\nThese are the valid options to pass to the `documentCaptureModule` instance\n\n```javascript\n{\n  // `publicMerchantKey` is available in your YVOS profile\n  \"publicMerchantKey\": \"<YOUR-PUBLIC-MERCHANT-KEY>\", // required\n          \n  // true if environment is in development mode.        \n  \"dev\":boolean,\n\n  // `personalInformation` is an object containing a list of predefined user attributes to be passed to the SDK for personalization of the experience\n  \"personalInformation\": {\n    \"firstName\": \"John\", // optional\n  },\n  \n  //pass country you want the document to be capture for. (optional)\n  country:\"Canada\",\n          \n   // pass the province in the country you entered above. (optional) leave blank if country does not have a province\n   province:'Ontario',\n\n   //list of document types you want in the country. (optional)\n   //for list of supported countries,province and document types see here\n   idTypes:[\"Passport\", \"Residence Permit\", \"Tribal ID\"],\n\n  // `metadata` is any other information you would like to pass to your webhook URL\n  \"metadata\": { // optional\n    // your custom keys\n  },\n\n  // `onSuccess` callback is a function called onced the document capture has a result\n  \"onSuccess\": (data) => { // optional\n    // data will contain the following\n    /* {\n      documentNumber: \"xyz\",\n      firstName: \"John\",\n      lastName: \"Doe\",\n      fullName: \"John Doe\",\n      dateOfBirth: \"29-01-2022\",\n      dateOfExpiry: \"29-01-2022\",\n      gender: \"M\",\n      rawMRZString: \"*****...\",\n      fullDocumentFrontImage: \"\", // base64 image of the document's front\n      fullDocumentBackImage: \"\", // base64 image of the document's back\n      fullDocumentImage: \"\", // base64 image of the document's front. Exists when there's no back image to be captured\n    }*/\n    // custom logic here\n  }\n\n  // `onCancel` callback is a function called onced the document capture process is cancelled\n  \"onCancel\": (data) => { // optional\n    // custom logic here\n  }\n\n  // `onClose` callback is a function called onced the document capture modal has been closed\n  \"onClose\": () => { // optional\n    // custom logic here\n  }\n}\n```\n\n## CloseSDKModal:\n\n| Method Name  | Parameters | Returns | Description                                              |\n| ------------ | ---------- | ------- | -------------------------------------------------------- |\n| setShowModal | Boolean    | Null    | This methods allows you to close the SDK modal via code. |\n\n## Credits\n\nThis SDK is developed and maintained solely by [Youverify](https://youverify.co)\n\n## License\n\nMIT License"},"npm":{"downloads":[{"from":"2022-11-16T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":59},{"from":"2022-11-10T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":141},{"from":"2022-10-18T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":339},{"from":"2022-08-19T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":693},{"from":"2022-05-21T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":1440},{"from":"2021-11-17T00:00:00.000Z","to":"2022-11-17T00:00:00.000Z","count":1569}],"starsCount":0},"source":{"files":{"readmeSize":10957,"testsSize":0},"linters":["eslint","prettier"]}},"evaluation":{"quality":{"carefulness":0.9199999999999999,"tests":0,"health":1,"branding":0},"popularity":{"communityInterest":0,"downloadsCount":231,"downloadsAcceleration":2.6756849315068494,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":0,"openIssues":0,"issuesDistribution":0}},"score":{"final":0.28330627380252055,"detail":{"quality":0.5400461886258112,"popularity":0.01321643013745873,"maintenance":0.3333333333333333}}}