1.55.3 • Published 6 months ago
@kount/kount-ivs-browser-sdk v1.55.3
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-sdkUsage
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
Install dependencies.
npm installCompile the SDK.
npm run prod-buildTest your changes locally.
// browser application's package.json "dependencies": { "@kount/kount-ivs-browser-sdk": "file:../sdk-typescript/dist", }