This is disabled by default, so to enable it set RECAPTCHA_ENABLED to true in your .env.Default version is set to v3 (reCAPTCHA v3). To update default version add RECAPTCHA_VERSION to your .env file and set its value to checkbox (I’m not a robot checkbox) or invisible (Invisible reCAPTCHA v2 badge).Passing score for v3 is set to 0.5 by default. To update score add RECAPTCHA_V3_SCORE to your .env file and set its value to desired score.
import Recaptcha from "@/Components/Form/Recaptcha.vue";const recaptcha = ref<{ execute: () => Promise<string>; reset: () => Promise<string>;} | null>(null);const form = useForm({ // You form data here... // Add this recaptcha: "",});
<form @submit.prevent="submit"> <Recaptcha ref="recaptcha" /> // Also add component to render the error message if validation fails <ErrorMessage :message="form.errors.recaptcha" /></form>