{"id":16959032,"url":"https://github.com/lgraziani2712/recaptcha","last_synced_at":"2026-05-08T08:09:26.077Z","repository":{"id":57108503,"uuid":"142006885","full_name":"lgraziani2712/recaptcha","owner":"lgraziani2712","description":"Simple JS function for ReCaptcha v3","archived":false,"fork":false,"pushed_at":"2018-07-23T12:47:49.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T08:49:31.509Z","etag":null,"topics":["captcha","client","recaptcha","verify"],"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/lgraziani2712.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-23T11:47:45.000Z","updated_at":"2021-04-28T05:54:38.000Z","dependencies_parsed_at":"2022-08-21T04:30:36.778Z","dependency_job_id":null,"html_url":"https://github.com/lgraziani2712/recaptcha","commit_stats":null,"previous_names":["dimax/recaptcha"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lgraziani2712/recaptcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraziani2712%2Frecaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraziani2712%2Frecaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraziani2712%2Frecaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraziani2712%2Frecaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lgraziani2712","download_url":"https://codeload.github.com/lgraziani2712/recaptcha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgraziani2712%2Frecaptcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32772119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"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","client","recaptcha","verify"],"created_at":"2024-10-13T22:44:07.762Z","updated_at":"2026-05-08T08:09:26.059Z","avatar_url":"https://github.com/lgraziani2712.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @dimax-ar/recaptcha\n\nSimple function for requesting tokens to the Google ReCaptcha v3 API. I want to thanks Codeep for writting https://github.com/codeep/react-recaptcha-v3/, without it I would't be able to easily write this lib, thank you!\n\n## Attention!\n\nReCaptcha v3 is still in beta, hence this lib too. The final API may change in the future.\n\n## Installation\n\n### With yarn\n\n```sh\nyarn add @dimax-ar/recaptcha\n```\n\n### With npm\n\n```sh\nnpm install --save @dimax-ar/recaptcha\n```\n\n## API\n\n### `loadReCaptcha(string): void`\n\n```js\nimport { loadReCaptcha } from '@dimax-ar/recaptcha';\n\n/**\n * Please, save your key in an environmental variable\n * instead of pasting it in the code, since can vary between\n * development and production environments.\n *\n * @param {String} key The recaptcha v3 client side key\n * @return {void}\n */\nloadReCaptcha(process.env.YOUR_CATPCHA_CLIENT_KEY);\n```\n\n### `reCaptcha(string, function): void`\n\n```js\nimport reCaptcha from '@dimax-ar/recaptcha';\n\n/**\n * @param {String} action\n *  The action the user is going to do in the page/section\n * @param {(token) =\u003e void} handleVerify\n *  The callback with the new token.\n */\nreCaptcha('action', handleVerify);\n```\n\n## Usage\n\n- ReCaptcha docs: https://developers.google.com/recaptcha/docs/v3\n- ReCaptcha registration: https://www.google.com/recaptcha/admin#v3signup\n\n### 1. Use `loadReCaptcha()` to initialize ReCaptcha\n\nThis function must be called once in the entry file.\n\n```js\n// entry file\nimport { loadReCaptcha } from '@dimax-ar/recaptcha';\n\nloadReCaptcha(process.env.YOUR_CATPCHA_CLIENT_KEY);\n```\n\n### 2. Use `reCaptcha` in any page/component to request a new token\n\n#### E.g. in a Vue component\n\n```js\nimport reCaptcha from '@dimax-ar/recaptcha';\n\nexport default {\n  created() {\n    reCaptcha('example-action', this.handleVerify);\n  },\n  methods: {\n    handleVerify(token) {\n      console.log(token);\n    },\n  },\n};\n```\n\n#### E.g. in React\n\n```jsx\nimport React from 'react';\nimport reCaptcha from '@dimax-ar/recaptcha';\n\nclass Example extends React.Component {\n  constructor() {\n    super();\n\n    reCaptcha('example-action', this.handleVerify);\n  }\n  handleVerify = (token) =\u003e {\n    console.log(token);\n  }\n}\n```\n\n### 3. Submit the token on a par with the data\n\nDocs: https://developers.google.com/recaptcha/docs/verify\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgraziani2712%2Frecaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flgraziani2712%2Frecaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgraziani2712%2Frecaptcha/lists"}