Web SDK Integration Guide
Last updated:2025-06-26
Expand all
Web SDK Integration Guide
Usage Notes
This document is the standard integration guide for the JVerification Web SDK.
- To quickly test, follow this guide to run the Demo in minutes.
- All guides, APIs, tutorials, and updated versions are published on the Jiguang documentation site.
Product Overview
JVerification integrates gateway authentication from China's three major carriers, providing phone number verification to improve registration/login and number verification while enhancing security.
Main Scenarios
- JS phone number verification
- JS one-click login
Obtain Application Info
After creating an app on the console, open App Settings → App Info to obtain the AppKey.
SDK Integration
- Add the following script to each page:
- Method 1 (v1.0.0) — dynamic script tag:
<script type="text/javascript" src="https://jverification.jiguang.cn/scripts/1.0.0/jverification-web.min.js"></script>
<script type="text/javascript" src="https://jverification.jiguang.cn/scripts/1.0.0/jverification-web.min.js"></script>
This code block is shown in the floating window
- Method 2 (v1.0.0+) — add meta tag manually. v5.0.0+ requires domain whitelist registration; report the version you use.
<script type="text/javascript" src="https://jverification.jiguang.cn/scripts/jverification-web.5.3.1.min.js"></script>
<script type="text/javascript" src="https://jverification.jiguang.cn/scripts/jverification-web.5.3.1.min.js"></script>
This code block is shown in the floating window
After loading the script, use the global JVerificationInterface on window.
- Configure China Mobile one-click login:
China Mobile one-click login requires crypto-js.js: https://github.com/brix/crypto-js/blob/master/crypto-js.js
// Example: local path — set src to your crypto-js.js path
<script type="text/javascript" src="./crypto-js.js"></script>
// Example: local path — set src to your crypto-js.js path
<script type="text/javascript" src="./crypto-js.js"></script>
This code block is shown in the floating window
SDK Initialization
window.JVerificationInterface.init({
appkey: "", // AppKey from Jiguang portal (required)
debugMode: true, // true prints more logs; false prints w/e only
domainName:"https://minio-sdk-res.qa.jpushoa.com",// since 5.0.0 developer domain (Jiguang demo example)
success: function(data) {
// Initialization success callback
},
fail: function(data) {
// Initialization failure callback
}
});
window.JVerificationInterface.init({
appkey: "", // AppKey from Jiguang portal (required)
debugMode: true, // true prints more logs; false prints w/e only
domainName:"https://minio-sdk-res.qa.jpushoa.com",// since 5.0.0 developer domain (Jiguang demo example)
success: function(data) {
// Initialization success callback
},
fail: function(data) {
// Initialization failure callback
}
});
This code block is shown in the floating window
More APIs
See: Web SDK API
Run the demo
The bundled example demonstrates the APIs. Open it in a browser to test.
Technical Support
Email: support@jiguang.cn
Was this document helpful?