tencent cloud

Web Client Upgrade Guide
Last updated: 2025-08-27 15:41:36
Web Client Upgrade Guide
Last updated: 2025-08-27 15:41:36
This document introduces how to smoothly upgrade the integrated Tencent Cloud Captcha 1.0 to Captcha 2.0 to enhance security and user experience.
Note:
To continuously enhance the stability and user experience of the verification code service, we have conducted technical upgrades and optimization for the CAM verification feature. The new version JS address https://ca.turing.captcha.qcloud.com/TJNCaptcha-global.js will offer more prompt and efficient service guarantee in performance support, feature iteration, etc.
If the current JS address https://ca.turing.captcha.qcloud.com/TCaptcha-global.js is still in use, we recommend that you gradually switch API calls to the latest version.
Note: If you have any questions during the operation process, welcome to contact us by submitting a ticket at any time. We will promptly offer support.

Upgrading the Client

1. Delete the reference code for Captcha 1.0 SDK resources.
<script src="https://ca.turing.captcha.qcloud.com/TCaptcha-global.js"></script>
2. Add new reference code for Captcha 2.0 SDK resources.
<script src="https://ca.turing.captcha.qcloud.com/TJNCaptcha-global.js"></script>
3. Delete the initialization code for Captcha 1.0.
var capctha = new TencentCaptcha('your appid', callback, {});
captcha.show();
4. Add new initialization code for Captcha 2.0.
<body>
<!-- Container for package captcha -->
<div id="tcaptcha"></div>
</body>
<script>
var capctha = new TencentCaptcha(document.getElementById("tcaptcha"), 'your appid', callback, {});
captcha.show();
</script>

Upgrading Example Code

Captcha 1.0 Access Example (Legacy)
Tencent Captcha 2.0 Access Example (New)
<html lang="en">
<head>
<script src="https://ca.turing.captcha.qcloud.com/TCaptcha-global.js"></script>
</head>
<script>
// use tencent captcha sdk
var capctha = new TencentCaptcha('your appid', callback, {});
captcha.show();
</script>
</html>
<html lang="en">
<head>
<script src="https://ca.turing.captcha.qcloud.com/TJNCaptcha-global.js"></script>
</head>
<body>
<!-- Container for package captcha -->
<div id="tcaptcha"></div>
</body>
<script>
// use tencent captcha sdk
var capctha = new TencentCaptcha(document.getElementById("tcaptcha"), 'your appid', callback, {});
captcha.show();
</script>
</html>


Comparing Captcha SDK Parameters

The parameters of new TencentCaptcha() differ in initialization. See the table below.
SDK Version/Parameter Description
First Parameter
Second Parameter
Third Parameter
Fourth Parameter
Captcha 1.0
AppId(String)
Callback(Functionn)
Options(Object)
-
Captcha 2.0
DOM(Element Nodes )
AppId(String)
Callback(Functionn)
Options(Object)

References

Comprehensive verification Captcha 2.0 client-side code, please refer to Web client access.
For more Captcha SDK parameter descriptions, see integration instruction.

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback