Widget reference
Configure the widget with data attributes or render it explicitly with JavaScript.
Playground
Change the options and watch a real widget update. The generated markup below it is ready to copy.
#6366f1index.html
Attributes
| Attribute | Values | Description |
|---|---|---|
data-sitekey | string | Required. Your public site key. |
data-theme | auto light dark | Color theme. Defaults to auto and follows the visitor's system setting. |
data-size | normal compact flexible | Normal is 300 by 65 pixels. Compact is 156 by 138. Flexible fills the available width. |
data-align | left center right | Horizontal position inside its container. |
data-accent | hex color | Accent color for the progress indicator, for example #f97316. |
data-language | auto en bn hi ar es fr de pt tr id | Interface language. auto uses the page or browser language. Arabic switches to right-to-left. |
data-callback | function name | Global function called with the token when verification succeeds. |
data-error-callback | function name | Global function called with an error code when verification fails. |
Example
<div class="recloud"
data-sitekey="YOUR_SITE_KEY"
data-theme="dark"
data-size="flexible"
data-align="center"
data-accent="#6366f1"
data-language="auto"
data-callback="onVerified"></div>
<script>
function onVerified(token) {
console.log("Token received", token);
}
</script>JavaScript API
Use these methods for single-page apps or when you add the widget dynamically.
| Method | Description |
|---|---|
recloud.render(element, options) | Renders the widget into an element or selector. Options mirror the data attributes: sitekey, theme, size, align, accent, language, callback, error-callback. |
recloud.reset(element) | Starts a new verification, for example after a failed form submission. |
recloud.getResponse(element) | Returns the current token, or null if verification is not complete. |
recloud.destroy(element) | Stops timers and pending work for a widget you are removing from the page. |
recloud.render("#captcha", {
sitekey: "YOUR_SITE_KEY",
theme: "light",
callback: function (token) { form.token.value = token; }
});Token lifetime
Tokens expire after five minutes and are valid for one verification. The widget refreshes the token automatically shortly before it expires, so long forms keep working.
Content Security Policy
If your site uses a strict policy, allow the following for https://recloud-turnstile.bunowave.shop:
script-srcfor the widget scriptconnect-srcfor the API requestsworker-src blob:for the background worker. If blocked, the widget falls back to the main thread automatically.