@persona-js/verify
A vanilla JavaScript module to run embedded/hosted flow without any dependencies, against the official npm module which has some dependencies in both internally/externally.
⚠️ This package is still in beta and missing some features of official module, so still not recommended using in production.
Install
npx i @persona-js/verify
Usage
import { newInquiry } from '@persona-js/verify'
const TEMPLATE_ID = 'tmpl_xyzxyzxyz'
const verificationWithPersona = newInquiry(TEMPLATE_ID)
verificationWithPersona.prefill({ nameFirst: 'Kengo' })
newInquiry(TEMPLATE_ID, { prefill: { nameFirst: 'Kengo' } })
verificationWIthPersona.on('start', (inquiryId) => { })
verificationWithPersona.getHostedFlowUrl()
verificationWithPersona.start()
newInquiry(TEMPLATE_ID)
.prefill({ nameLast: 'Hamasaki' })
.on('complete', (inquiryId) => { })
.on('fail', (inquiryId) => { })
.on('exit', () => { })
License
MIT
ToDo
- Use shadow DOM
- Avoid multiple UI insertions
- Support undocumented events?
- Like
verification-change
, country-select
...etc
- Support insertion into a specific element on HTML?
- Throw exceptions on unintentional parameters/arguments
- a11y
- ESM build
- Separate down the monolithic
index.ts
- License
- For each module
- For cdn build
- Test
- Demo
- Resume inquriy demo
- Popup events from embedded flow
- Do with TypeScript