Allpass.ai
HomeWeb SiteTerms of ServicesPrivacy Policy
  • Introduction
  • Get Started
    • Sign Up and Sign In
    • Navigation
    • Test and Live Modes
    • Company Settings
    • Application
    • Work With the Team
      • User Roles and Permissions
      • Send Invites and Assign Roles
    • Notifications Settings
  • Build Verification Flows
    • Flow Builder Overview
    • Verification Steps
      • Intro
      • Document Check
      • Liveness
      • Facematching
      • Selfie With a Document
      • Email Verification
      • Phone verification
      • AML
      • Crypto Transaction and Wallet Check
      • Questionnaire
      • Final Screen
    • UI Customization
    • Duplicate Workflows
    • Workflow Drafts
    • Questionnaire Builder
  • Verify Your Users
    • Run Verification Flows
    • Receiving and Completing Verification
    • Restart the Verification Flow
    • Change the Verification Flow
    • Request Additional Information
    • Manual Compliance Check
    • Manual Crypto Transaction and Wallet Monitoring
  • Review Data
    • Verification Status
    • Review Process
    • Applicant Profile
      • Document Check
      • Liveness
      • Facematch
      • Selfie with the document
      • Email Verification
      • Phone Verification
      • AML check
      • Crypto Transaction and Wallet Check
      • Questionnaire
      • IP and Geo Data
    • Applicant Timeline
    • Deactivating and Activating Verification Results
    • Applicant Profile Deletion
  • Download Reports
  • Analytics Dashboard
  • Integration
    • Overview
    • Get Started
    • How to use
    • Installation
    • Initialize
    • Render
    • Webhooks
      • Applicant Webhooks
      • Webhook Timestamp Validation Requirement
    • Open API
    • Dictionary
      • Enums
      • Entities
      • Term & Abbreviations
      • Supported Countries & Documents
    • Encryption
  • TROUBLESHOOTING
    • IP Address Detected as VPN
    • Incomplete User Verification Flows
Powered by GitBook

© 2024 Allpass.ai by elKYC OU. All rights reserved

On this page
  1. Integration

Render

PreviousInitializeNextWebhooks

Last updated 9 months ago

Place the new HTML element where you want the component to render inside the body of your HTML file:

<div id="allpass"></div>

In order for the verification flow to render correctly, you'll need to pass a valid accessToken as an argument to the start function. You can get accessToken from our public API. You can find more details in the section of our documentation.

const accessToken = 'ACCESS_TOKEN_FROM_PUBLIC_API';

Allpass.start(accessToken);

Make sure you're using your public App Key and Secret API Key from Integration Page

Example

GitHub repository with sample -

index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="icon" href="favicon.ico">
    <title>Title</title>
</head>
<body>
<div id="app">
    <div id="header">
        <h1>My Test Application</h1>
    </div>
    <div id="container">
        <div>
            <h3>Content</h3>
            <img id="loader" alt="loader" style="display: none" src="loader.gif"/>
            <button id="start">Start Verification</button>
        </div>
        <div id="allpass"></div>
    </div>
    <div id="footer">
        <p>Footer</p>
    </div>
    <script src="integration.js" async></script>
</div>
</body>
</html>
integration.js
const accessToken = 'ACCESS_TOKEN_FROM_PUBLIC_API';

(() => {
  const allpassId = 'allpass';
  /** UI actions */
  const setElmsDisplay = (hide, show) => {
    document.getElementById(hide).style.display = 'none';
    document.getElementById(show).style.display = 'block';
  }
  const finishUI = () => {
    setTimeout(() => {
      setElmsDisplay(allpassId, 'start');
      window.Allpass.close();
    }, 10000);
  };

  /** event handlers */
  const onLoad = (e) => {
    console.log('onLoad', e);
    setElmsDisplay('loader', allpassId);
  };
  const onRestart = (e) => {
    console.log('onRestart', e);
    setElmsDisplay('start', 'loader');
  };
  const onStart = (e) => {
    console.log('onStart', e);
  };
  const onPassStep = (e) => {
    console.log('onPassStep', e);
  };
  const onComplete = (e) => {
    console.log('onComplete', e);
    finishUI();
  };
  const onError = (e) => {
    console.log('onError', e);
    finishUI();
  };

  /** initialize Allpass SDK */
  const init = () => {
    window.Allpass.init({
      onLoad,
      onRestart,
      onStart,
      onPassStep,
      onComplete,
      onError,
    }).restart();
  };

  /** create Allpass library */
  const script = document.createElement('script');
  script.src = 'https://unpkg.com/@allpass/web-sdk';
  script.async = true;
  script.onload = () => init();
  document.body.appendChild(script);

  /** start verification process */
  document.getElementById('start').onclick = async () => {
    setElmsDisplay('start', 'loader');
    await window.Allpass.start(accessToken);
  };
})();
Public API
https://github.com/elkyc/allpass-web-sdk