{"id":37211620,"url":"https://github.com/flamego/hcaptcha","last_synced_at":"2026-01-15T00:05:51.152Z","repository":{"id":37982761,"uuid":"467090408","full_name":"flamego/hcaptcha","owner":"flamego","description":"Package hcaptcha is a middleware that provides hCaptcha integration for Flamego","archived":false,"fork":false,"pushed_at":"2025-01-01T16:18:16.000Z","size":46,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-01T17:20:48.204Z","etag":null,"topics":["captcha","flamego","go","hcaptcha","middleware"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/flamego.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":"2022-03-07T12:45:24.000Z","updated_at":"2025-01-01T16:18:18.000Z","dependencies_parsed_at":"2024-06-20T03:17:43.922Z","dependency_job_id":"e4955887-6aff-43a2-bda7-fb66b4a37430","html_url":"https://github.com/flamego/hcaptcha","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/flamego/hcaptcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fhcaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fhcaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fhcaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fhcaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flamego","download_url":"https://codeload.github.com/flamego/hcaptcha/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fhcaptcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","flamego","go","hcaptcha","middleware"],"created_at":"2026-01-15T00:05:50.472Z","updated_at":"2026-01-15T00:05:51.127Z","avatar_url":"https://github.com/flamego.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hcaptcha\n\n[![GitHub Workflow Status](https://img.shields.io/github/checks-status/flamego/hcaptcha/main?logo=github\u0026style=for-the-badge)](https://github.com/flamego/hcaptcha/actions?query=branch%3Amain)\n[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge\u0026logo=go)](https://pkg.go.dev/github.com/flamego/hcaptcha?tab=doc)\n\nPackage hcaptcha is a middleware that provides hCaptcha rendering integration for [Flamego](https://github.com/flamego/flamego).\n\n## Installation\n\n```zsh\ngo get github.com/flamego/hcaptcha\n```\n\n## Getting started\n\n```html\n\u003c!-- templates/home.tmpl --\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003cscript src=\"https://hcaptcha.com/1/api.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cform method=\"POST\"\u003e\n    \u003cdiv class=\"h-captcha\" data-sitekey=\"{{.SiteKey}}\"\u003e\u003c/div\u003e\n    \u003cinput type=\"submit\" name=\"button\" value=\"Submit\"\u003e\n  \u003c/form\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/flamego/flamego\"\n\t\"github.com/flamego/hcaptcha\"\n\t\"github.com/flamego/template\"\n)\n\nfunc main() {\n\tf := flamego.Classic()\n\tf.Use(template.Templater())\n\tf.Use(hcaptcha.Captcha(\n\t\thcaptcha.Options{\n\t\t\tSecret: \"\u003cSECRET\u003e\",\n\t\t},\n\t))\n\tf.Get(\"/\", func(t template.Template, data template.Data) {\n\t\tdata[\"SiteKey\"] = \"\u003cSITE KEY\u003e\"\n\t\tt.HTML(http.StatusOK, \"home\")\n\t})\n\n\tf.Post(\"/\", func(w http.ResponseWriter, r *http.Request, h hcaptcha.HCaptcha) {\n\t\ttoken := r.PostFormValue(\"h-captcha-response\")\n\t\tresp, err := h.Verify(token)\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t_, _ = w.Write([]byte(err.Error()))\n\t\t\treturn\n\t\t} else if !resp.Success {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t_, _ = w.Write([]byte(fmt.Sprintf(\"Verification failed, error codes %v\", resp.ErrorCodes)))\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, _ = w.Write([]byte(\"Verified!\"))\n\t})\n\n\tf.Run()\n}\n```\n\n## Getting help\n\n- Read [documentation and examples](https://flamego.dev/middleware/hcaptcha.html).\n- Please [file an issue](https://github.com/flamego/flamego/issues) or [start a discussion](https://github.com/flamego/flamego/discussions) on the [flamego/flamego](https://github.com/flamego/flamego) repository.\n\n## License\n\nThis project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamego%2Fhcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflamego%2Fhcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamego%2Fhcaptcha/lists"}