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.

#6366f1
index.html

Attributes

AttributeValuesDescription
data-sitekeystringRequired. Your public site key.
data-themeauto light darkColor theme. Defaults to auto and follows the visitor's system setting.
data-sizenormal compact flexibleNormal is 300 by 65 pixels. Compact is 156 by 138. Flexible fills the available width.
data-alignleft center rightHorizontal position inside its container.
data-accenthex colorAccent color for the progress indicator, for example #f97316.
data-languageauto en bn hi ar es fr de pt tr idInterface language. auto uses the page or browser language. Arabic switches to right-to-left.
data-callbackfunction nameGlobal function called with the token when verification succeeds.
data-error-callbackfunction nameGlobal 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.

MethodDescription
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-src for the widget script
  • connect-src for the API requests
  • worker-src blob: for the background worker. If blocked, the widget falls back to the main thread automatically.