Description
vue3-recaptcha-v2 is a Google reCAPTCHA v2 component for Vue 3 and Nuxt 3, written with the Composition API and shipped with TypeScript types. You install the package with yarn. In a Vue 3 project you register the plugin in main.ts. In Nuxt 3 you add it to the plugins folder, and the file name must contain .client so it runs only in the browser. The README describes a dynamic site key for cases where the key is known only at runtime, and it warns that the reCAPTCHA widget is rendered once, so changing the site key after rendering has no effect. The install options are sitekey, a required string with your reCAPTCHA key, and cnDomains, which defaults to false and switches the script address from www.google.com to www.recaptcha.net when set to true. The component options include a language prop for the widget's language, a theme prop with light and dark, a tabindex and a size. The README shows an invisible widget, a reset method that resets the widget, and a way to get the response from it. The usage section says the components are the same for Vue 3 and Nuxt 3, and only the installation differs. The project is hosted on GitHub.…
Highlights
- reCAPTCHA v2 component for Vue 3 and Nuxt 3
- Composition API and TypeScript types
- Invisible widget mode
- Reset and get-response methods
- Option to load the script from recaptcha.net
Ratings & Reviews
No ratings yet
Be the first to rate vue3-recaptcha-v2.
People also visit
vue3-recaptcha-v2 FAQ
What is vue3-recaptcha-v2?
A Google reCAPTCHA v2 component for Vue 3 and Nuxt 3, built on the Composition API.
How do I install it in Nuxt 3?
Add it to the plugins folder as a plugin whose file name contains .client, so it only runs in the browser.
Can I set the site key at runtime?
Yes, through the dynamic site key option described in the README. The widget renders once, so later key changes do not apply.
What does cnDomains do?
When set to true, it replaces www.google.com with www.recaptcha.net in the script address.
Does the component support an invisible widget?
Yes. The README has an invisible widget example, plus methods to reset the widget and get its response.
What are the best vue3-recaptcha-v2 alternatives?
Popular alternatives to vue3-recaptcha-v2 include vue-recaptcha, @hcaptcha/vue-hcaptcha and react-google-recaptcha. See all vue3-recaptcha-v2 alternatives





















