react-use-recaptcha-v3
Integration Google reCaptcha with React hooks.
Google ReCaptcha V3 with React Hooks
Installation
npm install react-use-recaptcha-v3 --save
Usage
site key for ReCaptcha V3
1. Get yourBack End side
2. Implement3. Use this package to send google re-captcha token to you Back End verifier
simplest way:
; const UncontrolledGoogleReCaptcha = { const siteKey = '[SET UP YOU SITE KEY HERE!!!]'; const token = ; return <form> /* other fields here */ token ? <input name="g-recaptcha" value=token /> : null </form> ;};
recommended way:
;; const ControlledGoogleReCaptcha = { const token setToken = ; const handleToken = { console; ; }; const siteKey = '[SET UP YOU SITE KEY HERE!!!]'; const actionName = 'submit'; // you can change actionName here if you need ; return <form> /* other fields here */ token ? <input name="g-recaptcha" value=token /> : null </form> ;};