{"id":22744177,"url":"https://github.com/steamer-academy/react-google-recaptcha","last_synced_at":"2025-04-12T22:06:23.398Z","repository":{"id":272005831,"uuid":"899850119","full_name":"STEAMer-Academy/react-google-recaptcha","owner":"STEAMer-Academy","description":"Component wrapper for Google reCAPTCHA 🤖","archived":false,"fork":false,"pushed_at":"2025-02-03T14:28:32.000Z","size":1365,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-12T22:06:18.778Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/STEAMer-Academy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"steameracademy","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2024-12-07T07:12:54.000Z","updated_at":"2025-03-03T08:16:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6e8e8e9-c7bb-4e46-a1e3-c5bec85b4de5","html_url":"https://github.com/STEAMer-Academy/react-google-recaptcha","commit_stats":null,"previous_names":["steamer-academy/react-google-recaptcha"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STEAMer-Academy%2Freact-google-recaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STEAMer-Academy%2Freact-google-recaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STEAMer-Academy%2Freact-google-recaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STEAMer-Academy%2Freact-google-recaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/STEAMer-Academy","download_url":"https://codeload.github.com/STEAMer-Academy/react-google-recaptcha/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637769,"owners_count":21137538,"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":"2024-12-11T01:40:41.779Z","updated_at":"2025-04-12T22:06:23.377Z","avatar_url":"https://github.com/STEAMer-Academy.png","language":"JavaScript","funding_links":["https://ko-fi.com/steameracademy"],"categories":[],"sub_categories":[],"readme":"[reCAPTCHA]: https://developers.google.com/recaptcha/docs/display\n[signup]: http://www.google.com/recaptcha/admin\n[docs_theme]: https://developers.google.com/recaptcha/docs/faq#can-i-customize-the-recaptcha-widget\n[reCAPTCHA hl]: https://developers.google.com/recaptcha/docs/language\n\n\u003ch3 align=\"center\"\u003e\u003cimg src=\"https://readme-typing-svg.demolab.com/?lines=React+Google+Recaptcha+🤖;\u0026font=Poppins\"\u003e\u003c/h3\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/STEAMer-Academy/react-google-recaptcha/actions/workflows/standard-ci.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/STEAMer-Academy/react-google-recaptcha/standard-ci.yml?logo=github\u0026style=for-the-badge\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://badge.fury.io/js/@steamer-academy%2Freact-google-recaptcha\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@steamer-academy/react-google-recaptcha.svg?logo=npm\u0026color=4eb551\u0026style=for-the-badge\" alt=\"npm version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://img.shields.io/npm/dm/@steamer-academy/react-google-recaptcha\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/@steamer-academy/react-google-recaptcha.svg?logo=download\u0026color=36B37E\u0026style=for-the-badge\" alt=\"npm downloads\"\u003e\n  \u003c/a\u003e\n\u003c/h4\u003e\n\n---\n\nReact component for [Google reCAPTCHA v2][reCAPTCHA].\n\n## 🚀 Installation\n\n```bash\nnpm install --save @steamer-academy/react-google-recaptcha\n```\n\n## 📖 Usage\n\nStart by [signing up for an API key pair][signup]. Use the client key with the `\u003cReCAPTCHA /\u003e` component as shown:\n\n### Basic Example\n\n```jsx\nimport ReCAPTCHA from \"react-google-recaptcha\";\n\nfunction onChange(value) {\n  console.log(\"Captcha value:\", value);\n}\n\nReactDOM.render(\n  \u003cReCAPTCHA\n    sitekey=\"Your client site key\"\n    onChange={onChange}\n  /\u003e,\n  document.body\n);\n```\n\n### Component Props\n\n| Name             | Type   | Description                                                                 |\n|------------------|--------|-----------------------------------------------------------------------------|\n| `asyncScriptOnLoad` | func  | *Optional.* Callback when the script has loaded.                           |\n| `badge`          | enum   | *Optional.* Badge position: `bottomright`, `bottomleft`, or `inline`.        |\n| `hl`             | string | *Optional.* Language code (e.g., `en`, `fr`). [Details][reCAPTCHA hl].       |\n| `isolated`       | bool   | *Optional.* Enable isolated mode. Default: `false`.                         |\n| `onChange`       | func   | Triggered when the user completes the captcha.                              |\n| `onErrored`      | func   | *Optional.* Callback for error events.                                      |\n| `onExpired`      | func   | *Optional.* Triggered when the challenge expires.                           |\n| `sitekey`        | string | *Required.* API client key.                                                 |\n| `size`           | enum   | *Optional.* Size of the captcha: `compact`, `normal`, or `invisible`.       |\n| `stoken`         | string | *Optional.* Secure token for enhanced security.                            |\n| `tabindex`       | number | *Optional.* Tabindex of the element. Default: `0`.                         |\n| `type`           | enum   | *Optional.* Challenge type: `image` or `audio`. Default: `image`.           |\n| `theme`          | enum   | *Optional.* Widget theme: `light` or `dark`. Default: `light`. [Example][docs_theme].\n\n### Advanced Features\n\n#### Invisible reCAPTCHA\n\nTo use an invisible reCAPTCHA, invoke the challenge programmatically using `execute` or `executeAsync`.\n\n```jsx\nimport ReCAPTCHA from \"react-google-recaptcha\";\n\nconst recaptchaRef = React.createRef();\n\nfunction handleSubmit() {\n  recaptchaRef.current.execute();\n}\n\nReactDOM.render(\n  \u003cform onSubmit={handleSubmit}\u003e\n    \u003cReCAPTCHA\n      ref={recaptchaRef}\n      size=\"invisible\"\n      sitekey=\"Your client site key\"\n    /\u003e\n  \u003c/form\u003e,\n  document.body\n);\n```\n\n#### Asynchronous Execution\n\n```jsx\nconst recaptchaRef = React.useRef();\n\nconst handleSubmit = async () =\u003e {\n  const token = await recaptchaRef.current.executeAsync();\n  console.log(\"Received token:\", token);\n};\n\nreturn (\n  \u003cform onSubmit={handleSubmit}\u003e\n    \u003cReCAPTCHA\n      ref={recaptchaRef}\n      size=\"invisible\"\n      sitekey=\"Your client site key\"\n    /\u003e\n  \u003c/form\u003e\n);\n```\n\n#### CSP Nonce Support\n\nAdd a nonce for strict Content Security Policy (CSP) compliance.\n\n```js\nwindow.recaptchaOptions = {\n  nonce: document.querySelector(\"meta[name='csp-nonce']\").getAttribute(\"content\"),\n};\n```\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamer-academy%2Freact-google-recaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamer-academy%2Freact-google-recaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamer-academy%2Freact-google-recaptcha/lists"}