This package implements google recaptcha code verification.
go get github.com/vloldik/gorecaptcha
// Create assessment service
assessmentService := gorecaptcha.NewAssessmentService(option, projectId, captchaKey)
// Create and validate assessment of given token, check if action is LOGIN and score is more than 0.4
assessment, err := assessmentService.CreateAndValidateAssessment(context, token, "LOGIN", 0.4)
An err will be nil if all conditions in the AssessmentService.ValidateAssessment()
function are met.
// With API key
option := option.WithAPIKey(apiKey)
// With Credentials.json (service credentials, etc.)
option := option.WithCredentialsFile(fileName)