1.55.3 • Published 12 months ago

@kount/kount-ivs-browser-sdk v1.55.3

Weekly downloads
-
License
UNLICENSED
Repository
gitlab
Last release
12 months ago

Equifax Identifier Verification Service SDK

Browser SDK used for IVS MFA session orchestration and token storage.

Please see the official documentation in Kount Developer.

Installation

npm install @kount/kount-ivs-browser-sdk

Usage

Initialization

Before using the SDK, initialize it with the required configuration:

import { init } from '@kount/kount-ivs-browser-sdk';

const config = {
  hostname: 'https://your-app.com',
  kountDomain: 'your-kount-domain',
  restIvsAddress: 'https://your-ivs-service.com',
  routes: {
    returnToDevice: '/return-to-device',
    verifyOtp: '/verify-sms-otp',
    error: '/error',
    termsAndConditions: '/terms-and-conditions',
  },
  kountCollectorUrl: 'collector.kaptcha.com',
};

await init(config);

Verification Example

Use the verification module to verify an OTP:

import { verification } from '@kount/kount-ivs-browser-sdk';

async function verifyOtp(otp: string) {
  kount.verification
    .verifyOtpRest(this.smsCode)
    .then(async (res: VerifyResponse) => {
      let s: string = res.getStatus().toString();
      console.log(s)
      window.location.href = res.getRedirectUri();
      }
    })
    .catch((err) => {
      console.warn(err);
    });
}

Contributing

  1. Install dependencies.

    npm install
  2. Compile the SDK.

    npm run prod-build
  3. Test your changes locally.

    // browser application's package.json
    
    "dependencies": {
       "@kount/kount-ivs-browser-sdk": "file:../sdk-typescript/dist",
    }