Getting Started
This page describes how to display and customize the One Captcha v3 Developer Beta widget on your web page.
Show One Captcha Widget
Step 1
Import the following One Captcha API JavaScript code into the <head>
tag of your HTML page code:
<script src="https://onecaptcha.us.kg/0/api.js"></script>
or
<script src="https://onecaptcha.us.kg/0/api_lite.js"></script>
ℹ️
We also have a test API (this test API can use some new features, but may not be stable):
<script src="https://onecaptcha.us.kg/0/api_test.js"></script>
Step 2
Add the HTML code that renders One Captcha in the <body>
tag of your HTML page file:
<div id="one-captcha" data-callback="Your Callback Function"></div>
Configuration properties
Name | Description |
---|---|
data-callback | The name of the callback function that is executed when the user submits a successful response. The one captcha token will be passed to your callback. |
data-lang | Optional, this is a custom language, currently supported languages |
Verify Captcha Response
After successful verification, One Captcha assigns a hashed ID to the website cookie: a one-time token. It also assigns a non-hashed token to the callback function, which you can retrieve from the cookie after encrypting the non-hashed token to a hashed value. The cookie token is valid for 15 seconds. After this time expires, the token will become invalid and the user must complete the verification process again.
data-callback example:
|
|
Last updated on