@hiveid/verify-js
TypeScript icon, indicating that this package has built-in type declarations

2.2.1 • Public • Published

Verify Web SDK

Browser

const applicationKey = "application key";
const customerId = "customer id";

const verificationBtn = document.getElementById("verification-btn");
const verificationContainer = document.getElementById("verification-container");

Verify.configure(applicationKey, {
  language: "en", // supported de, en, es, fr
  languageSelector: true, // default true
  mode: "modal", // modal (default) | inline
});

const handleVerificationCompleted = (payload) => {
  createCheck({ sessionId: payload.sessionId });
};

const handleVerificationCanceled = () => {
  console.log("Verification canceled");
};

const handleStartVerification = async () => {
  const sessionToken = await createSession({
    customerId,
    applicationKey,
  });

  Verify.mount(verificationContainer, sessionToken);
};

Verify.on("completed", handleVerificationCompleted);
Verify.on("canceled", handleVerificationCanceled);
verificationBtn.addEventListener("click", handleStartVerification);

Package Sidebar

Install

npm i @hiveid/verify-js

Weekly Downloads

1

Version

2.2.1

License

MIT

Unpacked Size

3.86 MB

Total Files

7

Last publish

Collaborators

  • yznatokov
  • antsiferovmaxim