verify-once
TypeScript icon, indicating that this package has built-in type declarations

1.29.0 • Public • Published

VerifyOnce

Downloads

Version

License

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 _.env to .env.
  • Make changes in the .env as needed.
  • Start the example by executing yarn start (npm start etc works as well).

Commands

  • yarn start to start the example application.
  • yarn build to build the production version.
  • yarn lint to lint the codebase.
  • yarn prettier to run prettier.

Readme

Keywords

none

Package Sidebar

Install

npm i verify-once

Weekly Downloads

2

Version

1.29.0

License

MIT

Unpacked Size

108 kB

Total Files

19

Last publish

Collaborators

  • timmu
  • ahtinurme
  • stenmlvc