ReCaptcha
Google's comprehensive bot protection and CAPTCHA service
About ReCaptcha
Google reCAPTCHA is one of the most widely-used CAPTCHA services, protecting millions of websites from spam and abuse. It uses advanced risk analysis to distinguish human users from bots through various challenge mechanisms.
For more information, visit the official Google reCAPTCHA documentation.
reCAPTCHA v3 is not supported yet. Currently only v2 (checkbox and invisible) are supported.
Showcase
Usage
import { ReCaptcha } from "@better-captcha/react/provider/recaptcha";
<ReCaptcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" options={{}} />import { component$ } from "@builder.io/qwik";
import { ReCaptcha } from "@better-captcha/qwik/provider/recaptcha";
export default component$(() => (
<ReCaptcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" options={{}} />
));import { ReCaptcha } from "@better-captcha/solidjs/provider/recaptcha";
<ReCaptcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" options={{}} /><template>
<ReCaptcha
sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
:options="{ theme: 'dark' }"
/>
</template>
<script setup lang="ts">
import { ReCaptcha } from "@better-captcha/vue/provider/recaptcha";
</script><script lang="ts">
import ReCaptcha from "@better-captcha/svelte/provider/recaptcha";
</script>
<ReCaptcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" options={{}} />import { ReCaptcha } from "@better-captcha/lit/provider/recaptcha";<recaptcha-captcha sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"></recaptcha-captcha>Configuration
Provider Options
Prop
Type
Imperative Handle
Prop
Type
Best Practices
- Choose the Right Version: Use v2 for interactive challenges, v3 for invisible score-based protection
- Handle Errors Gracefully: Always implement the
onErrorcallback to handle network failures - Verify Server-Side: Always verify the response token on your backend
- Consider UX: For v2 invisible, ensure users understand why they're seeing a challenge
- Auto Theme: Use
theme: "auto"to match your site's color scheme automatically