{"id":24499683,"url":"https://github.com/codewithkyle/craft-recaptcha","last_synced_at":"2025-03-15T07:16:01.374Z","repository":{"id":56955816,"uuid":"144909672","full_name":"codewithkyle/craft-recaptcha","owner":"codewithkyle","description":"Implements Google reCAPTCHA v3 as a Craft 3 Plugin","archived":false,"fork":false,"pushed_at":"2018-10-18T16:56:26.000Z","size":609,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T14:52:21.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/codewithkyle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-15T22:30:44.000Z","updated_at":"2018-10-18T16:55:54.000Z","dependencies_parsed_at":"2022-08-21T08:50:38.943Z","dependency_job_id":null,"html_url":"https://github.com/codewithkyle/craft-recaptcha","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithkyle%2Fcraft-recaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithkyle%2Fcraft-recaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithkyle%2Fcraft-recaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithkyle%2Fcraft-recaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithkyle","download_url":"https://codeload.github.com/codewithkyle/craft-recaptcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243695595,"owners_count":20332629,"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":[],"created_at":"2025-01-21T22:15:17.643Z","updated_at":"2025-03-15T07:16:01.351Z","avatar_url":"https://github.com/codewithkyle.png","language":"PHP","readme":"![Screenshot](resources/img/plugin-logo.png)\n\n# reCAPTCHA v3 for Craft CMS 3\n\nA simple craft plugin for validating Google's reCAPTCHA v3\n\n# Documentation\n\n## Installation\n\nTo install the plugin, follow these instructions.\n\n1. Open your terminal and tell composer to require the plugin `composer require codewithkyle/recaptcha`\n1. In the Control Panel, go to Settings -\u003e Plugins and click the “Install” button for Recaptcha.\n\n## Configuring\n\nGo to Settings -\u003e Plugins -\u003e reCAPTCHA for Craft -\u003e Settings. Paste your site and secret keys for [Google reCAPTCHA v3](https://www.google.com/recaptcha/admin).\n\n## Using recaptcha\n\n1. Build your form element [eg: form](docs/form-sample.md)\n1. Add your site key to the `\u003cform\u003e` element with `data-key=\"{{ craft.recaptcha.getPublicKey() }}\"`\n1. In JavaScript we need the following variables:\n  - `form = document.body.querySelector('form');`\n  - `var key = form.getAttribute('data-key');`\n1. Get Googles reCAPTCHA API with `\u003cscript src=\"https://www.google.com/recaptcha/api.js?render={{ craft.recaptcha.getPublicKey }}\"\u003e\u003c/script\u003e`\n  - Or get the API when you need it [sample code](docs/get-api.md)\n1. Execute `grecaptcha.execute` whenever users submit the form [sample code](docs/verification.md)\n1. Based on the response do what you need to do\n\n## Verification Response Object\n\nWhen verifying a token the server will respond with a verification JSON object. When parsed it will appear like:\n\n```\nObject{\n  action: \"type\",\n  score: 0.9,\n  status: 200,\n  timestamp: \"2018-08-03T19:48:00Z\"\n}\n```\n\n[Google's Documentation on Using Score](https://developers.google.com/recaptcha/docs/v3#score)\n\u003e reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot). Based on the score, you can take variable action in the context of your site.\n\n[Google's Documentation on Using Actions](https://developers.google.com/recaptcha/docs/v3#score)\n\u003e reCAPTCHA v3 introduces a new concept: actions. When you specify an action name in each place you execute reCAPTCHA you enable two new features:\n\u003e   - a detailed break-down of data for your top ten actions in the admin console\n\u003e   - adaptive risk analysis based on the context of the action (abusive behavior can vary)\n\u003e Importantly, when you verify the reCAPTCHA response you should also verify that the action name matches the one you expect.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithkyle%2Fcraft-recaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithkyle%2Fcraft-recaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithkyle%2Fcraft-recaptcha/lists"}