Sloxly Docs
OAuth Captcha Console

Getting Started with Captcha

Add Sloxly Captcha to your forms in 3 simple steps.

1. Create Captcha Keys

Go to the Developer Console, open your project, and navigate to Captcha Keys. Click Generate Keys to get:

2. Add the Widget

HTML
<!-- Load Sloxly Captcha SDK -->
<script src="https://api.sloxly.com/v1/Captcha/api.js"></script>

<form method="POST" action="/submit">
    <!-- Your form fields -->
    <input type="text" name="email" placeholder="Email">

    <!-- Captcha Widget -->
    <div class="sloxly-captcha"
         data-sitekey="YOUR_SITE_KEY"></div>

    <button type="submit">Submit</button>
</form>

3. Verify on Server

PHP
$token  = $_POST['sloxly_captcha_token'];
$secret = 'YOUR_SECRET_KEY';

$ch = curl_init("https://api.sloxly.com/v1/Captcha/verify.php");
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS     => http_build_query([
        'secret'  => $secret,
        'token'   => $token,
    ])
]);
$result = json_decode(curl_exec($ch), true);

if ($result['status'] === 'success') {
    // Captcha passed — process form
} else {
    // Captcha failed
}
That's it! Your form is now protected from bots.
← PreviousOverview