Integrate hCaptcha into your Flutter App without any dependency.

Getting started

Use pub to install package

flutter pub add hcaptcha

Now initialize hCaptcha using

HCaptcha.init(initialSite: '');
// OR
HCaptcha.init(siteKey: 'YOUR-SITE-KEY');

If you use initialSite then provide link to a html file with content

<!DOCTYPE html>
        <meta charset="utf-8">
        <title>Captcha Challenge</title>

        <div style="display: flex; justify-content: center;">
            <form method="POST">
                <div class="h-captcha" data-sitekey="YOUR_SECRET_GOES_HERE" data-callback="captchaCallback"></div>
                <script src="" async defer></script>

            function captchaCallback(response) {
                if (typeof Captcha!=="undefined") {


Inside your form, add the captcha logic when submitting:

if (_formKey.currentState!.validate()) {
    Map? captchaDetails = await;

    // validated
    if (captchaDetails != null) {
        // now use captchaDetails['code']