Create a custom verification integration in your web app. Upon positive verification, receive a unique token to send to our REST API for validation.
Positive verifications result in a unique access token, which you can securely pass to our REST API for validation and identifying information about the User.
Most Businesses using VerifyPass to offer a verified discount don’t need the JS-SDK.
Easier options exist, including customized landing pages or copy/paste code snippets for integrated verification. However, some Businesses prefer the custom functionality of a JavaScript Software Development Kit. The JS-SDK allows the Business to modify what happens before and after verification.
Compatible across all major browsers. JS-SDK authenticates Users with VerifyPass and returns token sent to REST API for validation.
<script src="https://cdn.verifypass.com/seller/launcher.js"></script>
This is the only script you need to integrate the JS-SDK.
<button type="button" id="myBtn">Open</button>
VFYPS.verify({
pub_key: "{your public key}",
initializer: document.getElementById("myBtn"),
onSuccess: function(token){
console.log(token); //Send to your backend for REST API validation
}
});
JS-SDK required and optional parameters.
Parameter | Type | Description |
---|---|---|
initializer | HTML Object | Elements assigned to launch verification. Can be a single element getElementById() or array of elements getElementsByClassName(). Also compatible with jQuery, for example $("#myBtn") or $(".myClass"). |
onSuccess | Function | Handles the return of a token, which is returned as a String. In most cases, you'll perform either AJAX or a standard POST request to your app with the token to be validated via IDS REST API. |
pub_key | String | Public key is found in your account page after enrolling in a Plan. |
Parameter | Type | Description |
---|---|---|
message | String | Overrides default Discount Description (within Settings). Note: Business Name may not be overridden. |
onLoad | Function | Callback for popup load success. This means your Public Key was accepted and the User reached authentication prompt. |
onClose | Function | Callback for popup closing. |
Validate your User access token from the JS-SDK. All responses are in JSON.
POST https://verifypass.com/token/{token}
Parameter | Type | Description |
---|---|---|
private_key | String | Private Key is from your account. Private Key must be from the same initiating account Public Key belonged in the JS-SDK. |
{
"email": "customer@example.com",
"first_name": "John",
"group": "mil",
"last_name": "Smith",
"verified": true
}
{
"error": "Invalid token."
}