# react-google-recaptcha-v3-hook

> React hook for google-recaptcha v3

Latest version **1.0.9** (published 2019-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-google-recaptcha-v3-hook
pnpm add react-google-recaptcha-v3-hook
yarn add react-google-recaptcha-v3-hook
bun add react-google-recaptcha-v3-hook
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2019-10-24 |
| First published | 2019-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | hello@webappsolutions.de |
| Maintainers | zoeying |
| Keywords | react, hook, google, recaptcha, grecaptcha, v3 |

## Links

- npm: https://www.npmjs.com/package/react-google-recaptcha-v3-hook
- Repository: https://github.com/zoexx/react-recaptcha-hook
- Homepage: https://github.com/zoexx/react-recaptcha-hook#readme
- Issues: https://github.com/zoexx/react-recaptcha-hook/issues
- npm.io page: https://npm.io/package/react-google-recaptcha-v3-hook

## Dependencies (1)

- [react-script-hook](https://npm.io/package/react-script-hook.md) ^1.0.10

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.9 (latest) — 2019-10-24

## README

# react-recaptcha-hook

> React hook for [google-recaptcha v3](https://developers.google.com/recaptcha/docs/v3)

## Install

```sh
// with npm
npm install react-recaptcha-hook

// with yarn
yarn add react-recaptcha-hook
```

## How to use

```javascript
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

- [Verify the User's Response](https://developers.google.com/recaptcha/docs/verify)
- [Domain/Package Name Validation](https://developers.google.com/recaptcha/docs/domain_validation)

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/react-google-recaptcha-v3-hook · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
