1.2.3 • Published 2 years ago

react-recaptcha-hook v1.2.3

Weekly downloads
713
License
MIT
Repository
github
Last release
2 years ago

react-recaptcha-hook

React hook for google-recaptcha v3

Install

// with npm
npm install react-recaptcha-hook

// with yarn
yarn add react-recaptcha-hook

How to use

import React, { useEffect } from 'react';
import { useRecaptcha, Badge } from 'react-recaptcha-hook';

const RecaptchaComponent = ({ action, sitekey, onToken }) => {
  const execute = useRecaptcha({ sitekey, hideDefaultBadge: true });

  useEffect(() => {
    const getToken = async () => {
      const token = await execute(action);
      onToken(token);
    };

    getToken();
  }, []);

  return <Badge />;
};

export default RecaptchaComponent;

Server side validation

License

MIT

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago