{"id":19623137,"url":"https://github.com/codeep/react-recaptcha-v3","last_synced_at":"2025-04-06T00:09:28.461Z","repository":{"id":32661684,"uuid":"138983545","full_name":"codeep/react-recaptcha-v3","owner":"codeep","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-29T01:20:59.000Z","size":114,"stargazers_count":78,"open_issues_count":11,"forks_count":42,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T23:08:56.177Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-06-28T07:38:34.000Z","updated_at":"2025-01-21T19:02:24.000Z","dependencies_parsed_at":"2024-11-11T11:44:37.671Z","dependency_job_id":null,"html_url":"https://github.com/codeep/react-recaptcha-v3","commit_stats":{"total_commits":28,"total_committers":8,"mean_commits":3.5,"dds":0.6428571428571428,"last_synced_commit":"293bb9f7993a65b246312a73fd0db2fdbc81eb5d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeep%2Freact-recaptcha-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeep%2Freact-recaptcha-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeep%2Freact-recaptcha-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeep%2Freact-recaptcha-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeep","download_url":"https://codeload.github.com/codeep/react-recaptcha-v3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"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-11-11T11:31:55.060Z","updated_at":"2025-04-06T00:09:28.433Z","avatar_url":"https://github.com/codeep.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-recaptcha-v3\n\nThis component is created in order to make the experience of integrating Google ReCaptcha into React apps easier and smoother.\n\nCurrently, we are using ReCaptcha V3, which is still in beta version; so, we will update our component when they release the stable version.\n\nP.S. It will open the ReCaptcha window only when there are some doubts by Google; otherwise, it will automatically generate the recaptcha token.\n\n# Google ReCaptcha V3\n\n## Installation\n\n`npm install react-recaptcha-v3 --save`\n\n## Usage\n\nFirst of all, get your site key for ReCaptcha V3 [here](https://www.google.com/recaptcha/admin#v3signup \"V3 signup\")\n\nThere are two steps that you need to implement.\n\n### 1. Use `loadReCaptcha()` to initialize the ReCaptcha\n\nThis function should be imported and called in the main (parent) component of your app. We recommend calling it in `componentDidMount()` of `App.js`.\n\n```\nimport { loadReCaptcha } from 'react-recaptcha-v3'\n\n...\n\ncomponentDidMount() {\n  loadReCaptcha(your_site_key, callback);\n}\n```\n\n### loadRecaptcha API\n\n| Parameters           | Type    | Default   | Required | Description                  |\n|----------------------|---------|-----------|----------|------------------------------|\n| your_site_key        | string  | undefined | true     | Corresponds to the site key you get from [here](https://www.google.com/recaptcha/admin#v3signup \"V3 signup\") |\n| callback             | func    | () =\u003e {}  | false    | Function called when grepcaptcha is correctly loaded |s\n\n\n### 2. Use `ReCaptcha` to integrate ReCaptcha in a particular component\n\n#### invisible Recaptcha\n\nCreate a new component with the following code and give it a try!\n\n```\nimport React, { Component } from 'react';\nimport { ReCaptcha } from 'react-recaptcha-v3'\n\nclass ExampleComponent extends Component {\n\n  verifyCallback = (recaptchaToken) =\u003e {\n    // Here you will get the final recaptchaToken!!!  \n    console.log(recaptchaToken, \"\u003c= your recaptcha token\")\n  }\n\n  updateToken = () =\u003e {\n    // you will get a new token in verifyCallback\n    this.recaptcha.execute();\n  }\n  render() {\n    return (\n      \u003cdiv\u003e\n\n        \u003cReCaptcha\n            ref={ref =\u003e this.recaptcha = ref}\n            sitekey=\"your_site_key\"\n            action='action_name'\n            verifyCallback={this.verifyCallback}\n        /\u003e\n\n        \u003ch2\u003eGoogle ReCaptcha with React \u003c/h2\u003e\n\n        \u003ccode\u003e\n          1. Add \u003cstrong\u003eyour site key\u003c/strong\u003e in the ReCaptcha component. \u003cbr/\u003e\n          2. Check \u003cstrong\u003econsole\u003c/strong\u003e to see the token.\n        \u003c/code\u003e\n      \u003c/div\u003e\n    );\n  };\n};\n\nexport default ExampleComponent;\n\n```\n\n### ReCaptcha props\n\n| Parameters           | Type    | Default   | Required | Description                  |\n|----------------------|---------|-----------|----------|------------------------------|\n| sitekey              | string  | undefined | true     | Corresponds to the site key you get from [here](https://www.google.com/recaptcha/admin#v3signup \"V3 signup\") |\n| action               | string  | undefined | true     | Name of the action performed by the reCaptcha, more on that [here](https://developers.google.com/recaptcha/docs/v3#Actions \"V3 actions\") |\n| verifyCallback       | func    | undefined | false     | This function will be called when reCaptcha is ready, and receives the recaptchaToken as the first and unique parameter |\n\n#### Actions\n\nThe ReCaptcha block can be triggered without a callback in order to trigger an action. \n\nSee https://developers.google.com/recaptcha/docs/v3#Actions for more Information.\n\n```\n\u003cReCaptcha\n    sitekey=\"your_site_key\"\n    action='action_name'\n/\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeep%2Freact-recaptcha-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeep%2Freact-recaptcha-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeep%2Freact-recaptcha-v3/lists"}