README
VerifyOnce
VerifyOnce verification service integration library and example.
Provides helpers for simple VerifyOnce service integration and example how to use it.
- Works with express server.
- Written in TypeScript, no need for extra typings.
Installation
This package is distributed via npm
npm install verify-once
yarn add verify-once
Usage
Credentials should be stored in projects config file. BaseUrl is optional param, for testing use dev or test prefix, defaults to https://app.verifyonce.com/api/verify
...
"verifyOnce": {
"password": "integratorPassword",
"username": "integratorUserName",
"baseUrl": "https://test-app.verifyonce.com/api/verify"
},
...
Initiating Verify Once transaction
import { VerifyOnce } from "verify-once";
...
// all optional, are used for autofill
const userData : InitiateRequest = {
country: CountryCode.BLR,
firstName: "John",
lastName: "Wick",
email: "john@wick.com",
}
// initiate verification
const verifyOnce = new VerifyOnce(config.verifyOnce);
// passing userData object is optional
const verifyOnceInitiateResponse : InitiateResponse = await verifyOnce.initiate(userData);
...
Example
The example is located in the /example directory.
Running the example
- Copy the example configuration file
_.envto.env. - Make changes in the
.envas needed. - Start the example by executing
yarn start(npm startetc works as well).
Commands
yarn startto start the example application.yarn buildto build the production version.yarn lintto lint the codebase.yarn prettierto run prettier.