Client Documentation

Dentity verification popup is provided by a single Javascript file. It will add a popup to the DOM. There are some special configurations provided and some functions are used to listen for events that occur during the popup’s lifecycle.

Step 1: Add verify button

Add a button tag or any other tag used to catch the event that calls the popup verification.

<button class="verify" id="selector">Click to verify</button>

Step 2: Add Dentity script

Add a script below to load a single Javascript file. Which is provided to add popups to the DOM. The script should be added at the end of the body tag and the bottom of the selector tag declared at Step 1.

<script src="https://cdn.dentity.com/static/popup/v1/dentity.min.js"></script>

Step 3: Configuration Dentity Popup

Configure Dentity pop-up and handle methods provided by Dentity.

<script>
   window.onload = function () {
     let dentity = new Dentity({
       element: '#selector,
       key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
     });
     dentity.onReady(() => {
       //A function called when the script has loaded and initialized
     });
     dentity.onShow(() => {
       //A function called when the verification popup is displayed
     });
     dentity.onHide(() => {
       //A function called when the verification popup is closed (hidden)
     });
     dentity.onChangeStatus((data) => {
       //A function that is called when the state of verification changes
     });
     dentity.onSubmit((data) => {
       //A function called on pre submit
     });
     dentity.onSubmitted((data, err) => {
       //A function called when submitted
     });
   };
 </script>

This script needs to be added below the script added in Step 2.

Here are two additional mandatory settings:

Dentity also provides some functions to listen for events during the pop-up’s lifecycle:

Last updated