Currently you are viewing v3 document of vue-recaptcha which is still in development

Migration from v2

1. set up the plugin

V3 need you to set up a Vue plugin before start using.

import { VueRecaptchaPlugin } from 'vue-recaptcha'

const app = createApp(App)
app.use(VueRecaptchaPlugin, {
  v2SiteKey: 'YOUR_SITE_KEY_HERE'
})

2. Provide reCAPTCHA script

To load the reCAPTCHA script, you will need to call useRecaptchaProvider in your app.vue

<script setup lang="ts">
import { useRecaptchaProvider } from 'vue-recaptcha'

useRecaptchaProvider()
</script>

3. Use the components

Now you can start using the components

If you are using the "I'm not a robot" checkbox, please use the <Checkbox />

<template>
  <Checkbox v-model="response" />
</template>

You can read more at here

If you are using the invisible reCAPTCHA, please use the <ChallengeV2 />

<template>
  <ChallengeV2 v-model="response">
    <button>submit</button>
  </ChallengeV2>
</template>

You can read more at here