t49tran / react-google-recaptcha-v3

Google Recaptcha V3 integration for React
MIT License
427 stars 91 forks source link

Is it possible to use recaptcha v2 as a fallback with this library? #184

Open cseas opened 10 months ago

cseas commented 10 months ago

Looks like a common use-case but isn't documented so opened this issue to segregate all the challenges that users face.

There could be different approaches for loading Recaptcha v2.

Approach 1 - Support in this library itself

Google's documentation mentions that the v3 script is able to load v2 as well. Can we enable that functionality within the react-google-recaptcha-v3 package so users can load v2 without having to use any other hacks? https://developers.google.com/recaptcha/docs/faq#can-i-run-recaptcha-v2-and-v3-on-the-same-page

Approach 2 - Document how to completely remove this library from DOM

The most common approach I've seen of users trying to use a fallback is to use a completely different npm package for Recaptcha v2. Example: https://github.com/dozoisch/react-google-recaptcha

There are several issues with this.

Approach 3 - Recommend another library

If v2 usage is completely out of scope for this package, can we add a note in the readme to recommend another package that's meant to solve for that use-case? Example: https://github.com/antokara/react-recaptcha-x This would also close the related issues mentioned in approach 2 above, since a lot of users are following those issues because they want to use v2 recaptcha as a fallback for this package.

lidorbt-esggo commented 6 months ago

anything new with these interesting solutions?