https://github.com/antelman107/recaptcha3
reCAPTCHA v3 backend tools
https://github.com/antelman107/recaptcha3
golang recaptcha-v3
Last synced: 5 months ago
JSON representation
reCAPTCHA v3 backend tools
- Host: GitHub
- URL: https://github.com/antelman107/recaptcha3
- Owner: antelman107
- Created: 2020-04-11T15:03:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-05T08:56:52.000Z (about 1 year ago)
- Last Synced: 2024-12-31T12:56:39.953Z (about 1 year ago)
- Topics: golang, recaptcha-v3
- Language: Go
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# reCAPTCHA v3 verifier
Call `Verify` to perform verify request ( https://developers.google.com/recaptcha/docs/verify#api_request ).
## Basic usage
```go
verifier := NewVerifier(&http.Client{})
resp, err := verifier.Verify(context.Background(), "secret", "token", "")
if err != nil {
return err
}
if !resp.Success {
return errors.New("you are bot")
}
```
## Specify request timeout
```go
verifier := NewVerifier(&http.Client{})
ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*10)
defer cancelFunc()
resp, err := verifier.Verify(ctx, "secret", "token", "")
if err != nil {
return err
}
```