{"id":13474136,"url":"https://github.com/HR/recaptcha-worker","last_synced_at":"2025-03-26T21:30:33.541Z","repository":{"id":79811966,"uuid":"304460434","full_name":"HR/recaptcha-worker","owner":"HR","description":"reCAPTCHA v3 Cloudflare Worker ","archived":false,"fork":false,"pushed_at":"2021-05-18T12:27:44.000Z","size":15,"stargazers_count":38,"open_issues_count":1,"forks_count":30,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-01T16:35:00.112Z","etag":null,"topics":["captcha","captcha-recaptcha","cloudflare","cloudflare-worker","cloudflare-workers","google-recaptcha","recaptcha","recaptcha-api","recaptcha-v3","recaptcha-verification","recaptcha-worker"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/HR.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}},"created_at":"2020-10-15T22:19:47.000Z","updated_at":"2024-02-25T12:34:11.000Z","dependencies_parsed_at":"2023-06-26T07:45:52.253Z","dependency_job_id":null,"html_url":"https://github.com/HR/recaptcha-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HR%2Frecaptcha-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HR%2Frecaptcha-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HR%2Frecaptcha-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HR%2Frecaptcha-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HR","download_url":"https://codeload.github.com/HR/recaptcha-worker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222169239,"owners_count":16942668,"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","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-recaptcha","cloudflare","cloudflare-worker","cloudflare-workers","google-recaptcha","recaptcha","recaptcha-api","recaptcha-v3","recaptcha-verification","recaptcha-worker"],"created_at":"2024-07-31T16:01:09.791Z","updated_at":"2024-10-30T05:30:36.208Z","avatar_url":"https://github.com/HR.png","language":"JavaScript","funding_links":[],"categories":["Workers"],"sub_categories":["Recipes"],"readme":"# Google reCAPTCHA v3 Cloudflare Worker\nGoogle reCAPTCHA v3 Cloudflare Worker that handles the server-side verification of your reCAPTCHA.\n\n## Installation\n\nThis requires you to have a Cloudflare Workers account and have the Workers CLI installed. If you haven't already, follow this https://developers.cloudflare.com/workers/get-started/guide\n\n1. Deploy it \n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/HR/recaptcha-worker)\n\n2. Set your [reCAPTCHA secret key](https://developers.google.com/recaptcha/intro) environment variable\n\n```\n$ wrangler secret put RECAPTCHA_SECRET --env recaptcha-worker\n```\n\n3. Write the client-side request code (see Usage) \n\n## Usage\n\n### Request\n\nFrom your client-side, make a `POST` request to your deployed cloudflare worker endpoint with the header field `g-recaptcha` set to your reCAPTCHA token.\n\nLike so:\n\n```Javascript\n$.ajax({\n  type: 'POST',\n  url: 'https://recaptcha-worker.YOUR-SUBDOMAIN.workers.dev',\n  headers: { 'g-recaptcha': YOUR_RECAPTCHA_TOKEN },\n  error: function (res, status, error) {\n    if (res.status === 400) {\n      // Verification failed\n    } else {\n      // An error occured\n      console.log(res.responseText)\n    }\n  },\n  success: function (res) {\n    // Verification successful \n    \n    // POST the form data to your backend or something\n  }\n})\n```\n\n### Response\n\nIf the verification request succeeds, you'll get a `202` HTTP status code response with the body `reCAPTCHA passed`. \n\nIf the verification request fails, you will get `400` HTTP status code response with the body `reCAPTCHA failed`. \n\nOtherwise, for any other error, you will get `500` HTTP status code response with the body being the error stack. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHR%2Frecaptcha-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHR%2Frecaptcha-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHR%2Frecaptcha-worker/lists"}