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.
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.
Step 3: Configuration Dentity Popup
Configure Dentity pop-up and handle methods provided by Dentity.
This script needs to be added below the script added in Step 2.
Here are two additional mandatory settings:
Option Name | Description |
---|---|
element (required) | A DOMString containing one or more selectors to match. This string must be a valid CSS selector string; if it isn’t, a SyntaxError exception is thrown. See Locating DOM elements using selectors for more about selectors and how to manage them. Example: #button-selector |
key (required) | The API key for your domain. You can add a domain on the Dentity business site and get this key. Example: d04c36169f39412696fbf020d793299f1641790047672 |
Dentity also provides some functions to listen for events during the pop-up’s lifecycle:
Function name | Description |
---|---|
onReady | A function that is called when the script has been initialized and is ready to be used. You can use it to check if the Dentity popup is ready before allowing the user to display it. |
onShow | A function called when the verification popup is displayed. |
onHide | A function called when the verification popup is closed. |
onChangeStatus | A function called when verification changes status. There are 3 statuses that can be returned: pending, verified, and failed. |
onSubmit | A function that is called before sending the data will generate the verification. It will return the data that will be sent. |
onSubmited | A function that is called after creating a successful verification. You can call the onChangeStatus function to be able to get the status of that verification after creating it. |
Last updated