An open API service indexing awesome lists of open source software.

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

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