Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 881 Bytes

File metadata and controls

33 lines (20 loc) · 881 Bytes

go-recaptcha

About

This package handles reCaptcha (API version 3.0) form submissions in Go.

Usage

Install the package in your environment:

go get github.com/hazcod/go-recaptcha

To use it within your own code, import github.com/hazcod/go-recaptcha and call:

recaptcha := Recaptcha{ PrivateKey: "your-recaptcha-private-key" }

Now call recaptcha.Verify(remoteip net.IP, action string, response string, minScore uint) which will return (success bool, err error).

Usage Example

Included with this repo is example.go, a simple HTTP server which creates the reCaptcha form and tests the input.

See the instructions for running the example for more details.