Skip to content

Commit

Permalink
fix: Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Feb 21, 2020
1 parent e041aff commit 4028d21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
29 changes: 2 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,9 @@ npm install react-recaptcha-hook
yarn add react-recaptcha-hook
```

## How to use
## Documentation

```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)
[Read the documentation](/react-recaptcha-hook/README.md).

## License

Expand Down
2 changes: 1 addition & 1 deletion react-recaptcha-hook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ yarn add react-recaptcha-hook

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

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

0 comments on commit 4028d21

Please sign in to comment.