@persona-js/verify
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "@persona-js/verify", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "An unofficial Persona client to verify customers", | ||
@@ -14,3 +14,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "0783bb13fcdbfb078f14164411d91092b46bcb97" | ||
"gitHead": "048c33426c996e6e11606fec956cd9de00f63375" | ||
} |
# @persona-js/verify | ||
An unofficial Persona client to verify customers | ||
[![npm](https://img.shields.io/npm/v/@persona-js/verify.svg?style=for-the-badge)](https://www.npmjs.com/package/@persona-js/verify) | ||
A vanilla JavaScript module to run embedded/hosted flow without any dependencies, against [the official npm module](https://www.npmjs.com/package/persona) which has some dependencies in both internally/externally. | ||
⚠️ This package is still in beta and missing many features of official module, so don't recommend using in production. | ||
## Install | ||
@@ -11,16 +15,23 @@ | ||
## Usage (Expected) | ||
## Usage | ||
```ts | ||
import { newInquiry } from '@persona-js/verify' | ||
const verificationWithPersona = newInquiry('template_id').on('start', () => { /* what I want to do on start inquiry flow */ }) | ||
const TEMPLATE_ID = 'tmpl_xyzxyzxyz' | ||
verificationWIthPersona.on('complete', () => { /* what I want to do on complete inquiry flow */ }) | ||
const verificationWithPersona = newInquiry(TEMPLATE_ID) | ||
verificationWithPersona.prefill({ ... }) | ||
// prefilling | ||
verificationWithPersona.prefill({ nameFirst: 'Kengo' }) | ||
verificationWithPersona.start() | ||
verificationWithPersona.getHostedFlowUrl() | ||
// Also constructor function can accepts prefiling | ||
newInquiry(TEMPLATE_ID, { prefill: { nameFirst: 'Kengo' } }) | ||
verificationWithPersona.start() //=> Embedded flow starts on current window | ||
verificationWithPersona.getHostedFlowUrl() //=> Returns URL for the hosted flow | ||
// Unsupported yet | ||
verificationWIthPersona.on('start', () => { /* what I want to do on start inquiry flow */ }) | ||
verificationWIthPersona.on('complete', () => { /* what I want to do on complete inquiry flow */ }) | ||
``` | ||
@@ -31,1 +42,12 @@ | ||
MIT | ||
## ToDo | ||
- Support event listeners | ||
- Resume inquriy demo | ||
- Style polishing | ||
- mobile | ||
- transition | ||
- a11y | ||
- Test | ||
- Build for CDN distribution |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15728
52