{"id":23131165,"url":"https://github.com/friendlycaptcha/friendly-captcha-go","last_synced_at":"2026-02-17T12:14:43.929Z","repository":{"id":237404582,"uuid":"738503263","full_name":"FriendlyCaptcha/friendly-captcha-go","owner":"FriendlyCaptcha","description":"Go SDK for Friendly Captcha v2","archived":false,"fork":false,"pushed_at":"2024-10-21T14:17:38.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T05:49:08.333Z","etag":null,"topics":["captcha","captcha-go","friendly-captcha","go-sdk","library","sdk","sdk-go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FriendlyCaptcha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-03T11:29:18.000Z","updated_at":"2024-11-29T17:27:50.000Z","dependencies_parsed_at":"2024-05-01T09:47:52.148Z","dependency_job_id":"e2e6d7db-29be-4b89-9484-49430307c949","html_url":"https://github.com/FriendlyCaptcha/friendly-captcha-go","commit_stats":null,"previous_names":["friendlycaptcha/friendly-captcha-go"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/FriendlyCaptcha/friendly-captcha-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendlyCaptcha","download_url":"https://codeload.github.com/FriendlyCaptcha/friendly-captcha-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278912577,"owners_count":26067487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","captcha-go","friendly-captcha","go-sdk","library","sdk","sdk-go"],"created_at":"2024-12-17T11:12:12.733Z","updated_at":"2026-02-17T12:14:43.924Z","avatar_url":"https://github.com/FriendlyCaptcha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Friendly Captcha Go SDK\n\nA Go client for the [Friendly Captcha](https://friendlycaptcha.com) service. This client allows for easy integration and verification of captcha responses with the Friendly Captcha API.\n\n\u003e This library is for [Friendly Captcha V2](https://developer.friendlycaptcha.com) only. If you are looking for V1, look [here](https://docs.friendlycaptcha.com)\n\n## Installation\n\n```shell\ngo get github.com/friendlycaptcha/friendly-captcha-go\n```\n\n## Usage\n\nBelow are some basic examples of how to use the client.\n\nFor a more detailed example, take a look at the [example](./example) directory.\n\n### Initialization\n\n```go\nimport friendlycaptcha \"github.com/friendlycaptcha/friendly-captcha-go\"\n...\nopts := []friendlycaptcha.ClientOption{\n\t\tfriendlycaptcha.WithAPIKey(\"YOUR_API_KEY\"),\n\t\tfriendlycaptcha.WithSitekey(\"YOUR_SITEKEY\"),\n}\nfrcClient, err := friendlycaptcha.NewClient(opts...)\nif err != nil {\n    // handle possible configuration error\n}\n```\n\n### Verifying a Captcha Response\n\nAfter calling `VerifyCaptchaResponse` with the captcha response there are two functions on the result object that you should check:\n\n- `WasAbleToVerify()` indicates whether we were able to verify the captcha response. This will be `false` in case there was an issue with the network/our service or if there was a mistake in the configuration.\n- `ShouldAccept()` indicates whether the captcha response was correct. If the client is running in non-strict mode (default) and `WasAbleToVerify()` returned `false`, this will be `true`.\n\nBelow are some examples of this behaviour.\n\n#### Verifying a correct captcha response without issues when veryfing:\n\n```go\nresult := frcClient.VerifyCaptchaResponse(context.TODO(), \"CORRECT_CAPTCHA_RESPONSE_HERE\")\nfmt.Println(result.WasAbleToVerify()) // true\nfmt.Println(result.ShouldAccept()) // true\n```\n\n#### Verifying an incorrect captcha response without issues when veryfing:\n\n```go\nresult := frcClient.VerifyCaptchaResponse(context.TODO(), \"INCORRECT_CAPTCHA_RESPONSE_HERE\")\nfmt.Println(result.WasAbleToVerify()) // true\nfmt.Println(result.ShouldAccept()) // false\n```\n\n#### Verifying an incorrect captcha response with issues (network issues or bad configuration) when veryfing in non-strict mode (default):\n\n```go\nresult := frcClient.VerifyCaptchaResponse(context.TODO(), \"INCORRECT_CAPTCHA_RESPONSE_HERE\")\nfmt.Println(result.WasAbleToVerify()) // false\nfmt.Println(result.ShouldAccept()) // true\n```\n\n#### Verifying an incorrect captcha response with issues (network/service issues or bad configuration) when veryfing in strict mode:\n\n```go\nfrcClient, _ := friendlycaptcha.NewClient(\n    ...\n    friendlycaptcha.WithStrictMode(true),\n)\nresult := frcClient.VerifyCaptchaResponse(context.TODO(), \"INCORRECT_CAPTCHA_RESPONSE_HERE\")\nfmt.Println(result.WasAbleToVerify()) // false\nfmt.Println(result.ShouldAccept()) // false\n```\n\n### Configuration\n\nThe client offers several configuration options:\n\n- **WithAPIKey**: Your Friendly Captcha API key.\n- **WithSitekey**: Your Friendly Captcha sitekey.\n- **WithStrictMode**: (Optional) In case the client was not able to verify the captcha response at all (for example if there is a network failure or a mistake in configuration), by default the `VerifyCaptchaResponse` returns `True` regardless. By passing `WithStrictMode(true)`, it will return `false` instead: every response needs to be strictly verified.\n- **WithAPIEndpoint**: (Optional) The endpoint for the site verification API. Shorthands `eu` or `global` are also accepted. Default is `global`.\n\n## Development\n\n### Run the tests\n\nFirst run the SDK Test server, then run `go test`.\n\n```shell\ndocker run -p 1090:1090 friendlycaptcha/sdk-testserver:latest\n\ngo test -v -tags=sdkintegration ./...\n```\n\n## License\n\nOpen source under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-go/lists"}