Widget Setup
The Sloxly Captcha widget renders automatically when you include the SDK and add the widget container.
Basic Setup
HTML
<script src="https://api.sloxly.com/v1/Captcha/api.js"></script> <div class="sloxly-captcha" data-sitekey="YOUR_SITE_KEY"></div>
Widget Attributes
| Attribute | Required | Description |
|---|---|---|
data-sitekey | Yes | Your captcha site key |
data-theme | No | auto, light, or dark (default: auto) |
data-callback | No | JS function name called on success |
data-expired-callback | No | JS function called when token expires |
Dark Theme Example
HTML
<div class="sloxly-captcha" data-sitekey="YOUR_SITE_KEY" data-theme="dark"></div>
Callback Example
HTML + JS
<div class="sloxly-captcha" data-sitekey="YOUR_KEY" data-callback="onCaptchaSuccess"></div> <script> function onCaptchaSuccess(token) { console.log('Captcha solved! Token:', token); document.getElementById('submitBtn').disabled = false; } </script>