{"_id":"@03balogun/react-native-google-recaptcha","_rev":"2-927c152db460ea536d2f34132f120173","name":"@03balogun/react-native-google-recaptcha","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.9":{"name":"@03balogun/react-native-google-recaptcha","version":"1.0.9","keywords":["recaptcha","react native","google recaptcha","react native recaptcha","react native google recaptcha"],"license":"MIT","_id":"@03balogun/react-native-google-recaptcha@1.0.9","maintainers":[{"name":"03balogun","email":"03balogun@gmail.com"}],"homepage":"https://github.com/bilaleren/react-native-google-recaptcha","bugs":{"url":"https://github.com/bilaleren/react-native-google-recaptcha/issues"},"dist":{"shasum":"e41db14f44d14c21a29a3658abcbdeb84c8ac3cc","tarball":"https://registry.npmjs.org/@03balogun/react-native-google-recaptcha/-/react-native-google-recaptcha-1.0.9.tgz","fileCount":5,"integrity":"sha512-Lv21ATivdw/k6A6iQaJCaupllvPCqYy8iY+Nc2VaO3nZvfZbwO5g+3Mif57C/DBTkOVCjBU0tOB6MI31s5ELyA==","signatures":[{"sig":"MEQCIEw/Z23KUH8qYzhbGB7WqS6MEi8QZn3Tx9kULSv5nt2WAiA39niZvm70YyHS+zFhTHdYK0LIAVCh4fZD/7HMV3/9LA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26780},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"0cd827b90dd0916e8bce397ecb30c3bb377ac694","scripts":{"lint":"tsc --noEmit && eslint ./src --ext .ts,.tsx","test":"LANG=\"en_US.UTF-8\" jest","build":"NODE_ENV=production rollup -c --bundleConfigAsCjs","format":"prettier --write \"src/**/*.{ts,tsx}\"","prebuild":"yarn test && yarn lint && rm -rf dist","test:watch":"yarn test --watchAll","prepare:package":"cd ./dist && mkdir dist && mv *.js *.d.ts ./dist && cp ../package.json ."},"_npmUser":{"name":"03balogun","email":"03balogun@gmail.com"},"repository":{"url":"git+https://github.com/bilaleren/react-native-google-recaptcha.git","type":"git"},"_npmVersion":"10.9.2","description":"A reCAPTCHA library for React Native (Android and iOS).","directories":{},"_nodeVersion":"23.11.0","dependencies":{"use-latest-callback":"^0.3.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","react":"^18.2.0","eslint":"7","rollup":"^3.5.0","prettier":"^2.8.0","babel-jest":"^29.3.1","typescript":"^4.9.3","@babel/core":"^7.20.5","@types/jest":"^26.0.23","@types/react":"^18.0.25","babel-loader":"^9.1.0","react-native":"^0.72.7","@babel/runtime":"^7.20.6","rollup-plugin-ts":"^3.0.2","@babel/preset-env":"^7.20.2","rollup-plugin-dts":"^5.0.0","@babel/preset-flow":"^7.18.6","@babel/preset-react":"^7.18.6","@types/react-native":"^0.70.7","eslint-plugin-react":"^7.31.11","react-test-renderer":"^18.2.0","react-native-webview":"^11.26.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@babel/preset-typescript":"^7.18.6","@typescript-eslint/parser":"^5.3.1","eslint-plugin-react-hooks":"^4.2.0","@types/react-test-renderer":"^18.0.0","eslint-plugin-react-native":"^4.0.0","@testing-library/jest-native":"^5.3.0","rollup-plugin-node-externals":"^5.0.2","@testing-library/react-native":"^11.5.0","@babel/plugin-transform-runtime":"^7.19.6","metro-react-native-babel-preset":"^0.73.3","@typescript-eslint/eslint-plugin":"^5.3.1","babel-plugin-jsx-remove-data-test-id":"^3.0.0"},"peerDependencies":{"react":"*","react-native":"*","@babel/runtime":"*","react-native-webview":">=11.26.0"},"_npmOperationalInternal":{"tmp":"tmp/react-native-google-recaptcha_1.0.9_1769753996713_0.03467266466602159","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@03balogun/react-native-google-recaptcha","version":"1.0.0","description":"A reCAPTCHA library for React Native (Android and iOS).","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","homepage":"https://github.com/03balogun/react-native-google-recaptcha","repository":{"type":"git","url":"git+https://github.com/03balogun/react-native-google-recaptcha.git"},"keywords":["recaptcha","react native","google recaptcha","react native recaptcha","react native google recaptcha"],"scripts":{"test":"LANG=\"en_US.UTF-8\" jest","test:watch":"yarn test --watchAll","prebuild":"yarn test && yarn lint && rm -rf dist","build":"NODE_ENV=production rollup -c --bundleConfigAsCjs","format":"prettier --write \"src/**/*.{ts,tsx}\"","lint":"tsc --noEmit && eslint ./src --ext .ts,.tsx","prepare:package":"cd ./dist && mkdir dist && mv *.js *.d.ts ./dist && cp ../package.json ."},"dependencies":{"use-latest-callback":"^0.3.3"},"peerDependencies":{"@babel/runtime":"*","react":"*","react-native":"*","react-native-webview":">=11.26.0"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-runtime":"^7.19.6","@babel/preset-env":"^7.20.2","@babel/preset-flow":"^7.18.6","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.18.6","@babel/runtime":"^7.20.6","@testing-library/jest-native":"^5.3.0","@testing-library/react-native":"^11.5.0","@types/jest":"^26.0.23","@types/react":"^18.0.25","@types/react-native":"^0.70.7","@types/react-test-renderer":"^18.0.0","@typescript-eslint/eslint-plugin":"^5.3.1","@typescript-eslint/parser":"^5.3.1","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-jsx-remove-data-test-id":"^3.0.0","eslint":"7","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-react":"^7.31.11","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-react-native":"^4.0.0","jest":"^29.0.3","metro-react-native-babel-preset":"^0.73.3","prettier":"^2.8.0","react":"^18.2.0","react-native":"^0.72.7","react-native-webview":"^11.26.1","react-test-renderer":"^18.2.0","rollup":"^3.5.0","rollup-plugin-dts":"^5.0.0","rollup-plugin-node-externals":"^5.0.2","rollup-plugin-ts":"^3.0.2","typescript":"^4.9.3"},"_id":"@03balogun/react-native-google-recaptcha@1.0.0","gitHead":"0cd827b90dd0916e8bce397ecb30c3bb377ac694","bugs":{"url":"https://github.com/03balogun/react-native-google-recaptcha/issues"},"_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-TXmPND/yv/SsOTH3YyJ/WUOpGhn9M+je+zZhnm/7TA5f7OQWuzOlhjKHwvSdip7qZMRoDIsH4Ej1Q7y9GTn8RQ==","shasum":"80fc13d1ab17ef3465f9c9fab3dbe0397c037063","tarball":"https://registry.npmjs.org/@03balogun/react-native-google-recaptcha/-/react-native-google-recaptcha-1.0.0.tgz","fileCount":5,"unpackedSize":26780,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICILKL+GvNMtanJYhM+naFYGkDLup9nIJdHq/MrrFWVHAiEA0n3zP+mkB8+FZOVCNCEH2xeL4p5nPdYXDkBr+IqxT5w="}]},"_npmUser":{"name":"03balogun","email":"03balogun@gmail.com"},"directories":{},"maintainers":[{"name":"03balogun","email":"03balogun@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-google-recaptcha_1.0.0_1769754151494_0.6215372229715872"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-30T06:19:56.625Z","modified":"2026-01-30T06:22:31.775Z","1.0.9":"2026-01-30T06:19:56.871Z","1.0.0":"2026-01-30T06:22:31.661Z"},"bugs":{"url":"https://github.com/03balogun/react-native-google-recaptcha/issues"},"license":"MIT","homepage":"https://github.com/03balogun/react-native-google-recaptcha","keywords":["recaptcha","react native","google recaptcha","react native recaptcha","react native google recaptcha"],"repository":{"type":"git","url":"git+https://github.com/03balogun/react-native-google-recaptcha.git"},"description":"A reCAPTCHA library for React Native (Android and iOS).","maintainers":[{"name":"03balogun","email":"03balogun@gmail.com"}],"readme":"# reCAPTCHA for React Native (Android and iOS)\n\n![](https://badgen.net/npm/license/react-native-google-recaptcha)\n[![](https://img.shields.io/npm/v/react-native-google-recaptcha.svg)](https://www.npmjs.com/package/react-native-google-recaptcha)\n![](https://badgen.net/packagephobia/install/react-native-google-recaptcha)\n![](https://badgen.net/bundlephobia/min/react-native-google-recaptcha)\n![](https://badgen.net/bundlephobia/minzip/react-native-google-recaptcha)\n![](https://badgen.net/npm/dw/react-native-google-recaptcha)\n![](https://badgen.net/npm/dm/react-native-google-recaptcha)\n\nA reCAPTCHA library for React Native (Android and iOS). Fully tested.\n\n---\n\nA normal widget.\n\n<details open>\n  <summary>\n    <b>Normal</b>\n  </summary>\n  <br />\n  <img\n    alt=\"Normal\"\n    width=\"320\"\n    height=\"540\"\n    src=\"https://raw.githubusercontent.com/bilaleren/react-native-google-recaptcha/master/screenshots/normal.gif\"\n  />\n</details>\n\n---\n\nA invisible widget.\n\n<details>\n  <summary>\n    <b>Invisible</b>\n  </summary>\n  <br />\n  <img\n    alt=\"Normal\"\n    width=\"320\"\n    height=\"540\"\n    src=\"https://raw.githubusercontent.com/bilaleren/react-native-google-recaptcha/master/screenshots/invisible.gif\"\n  />\n</details>\n\n---\n\nA compact widget.\n\n<details>\n  <summary>\n    <b>Compact</b>\n  </summary>\n  <br />\n  <img\n    alt=\"Normal\"\n    width=\"320\"\n    height=\"540\"\n    src=\"https://raw.githubusercontent.com/bilaleren/react-native-google-recaptcha/master/screenshots/compact.gif\"\n  />\n</details>\n\n---\n\n## Install\n\n### Install the module\n\n```bash\nyarn add react-native-webview react-native-google-recaptcha\n```\n\nOr\n\n```bash\nnpm i react-native-webview react-native-google-recaptcha\n```\n\nSee the [`react-native-webview` Getting Started Guide](https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md).\n\n## Import structure\n\n```typescript\nimport GoogleRecaptcha, {\n  // Enums\n  GoogleRecaptchaSize, // Size enum: such GoogleRecaptchaSize.INVISIBLE\n  GoogleRecaptchaTheme, // Theme enum: such GoogleRecaptchaTheme.DARK\n  GoogleRecaptchaActionName, // Action name enum: such GoogleRecaptchaActionName.LOGIN\n  DEFAULT_GSTATIC_DOMAIN,\n  DEFAULT_RECAPTCHA_DOMAIN,\n  // Types (only typescript)\n  GoogleRecaptchaToken,\n  GoogleRecaptchaProps,\n  GoogleRecaptchaBaseProps,\n  GoogleRecaptchaRefAttributes\n} from 'react-native-google-recaptcha'\n```\n\n## Usage\n\nWith callback `onVerify()` method:\n\n```tsx\nimport React from 'react'\nimport { View, Button } from 'react-native'\n\nimport GoogleRecaptcha, {\n  GoogleRecaptchaToken,\n  GoogleRecaptchaRefAttributes\n} from 'react-native-google-recaptcha'\n\nconst App: React.FC = () => {\n  const recaptchaRef = React.useRef<GoogleRecaptchaRefAttributes>(null)\n\n  const handleSend = () => {\n    recaptchaRef.current?.open()\n  }\n\n  const handleVerify = (token: GoogleRecaptchaToken) => {\n    console.log('Recaptcha Token:', token)\n  }\n\n  const handleError = (error: unknown) => {\n    console.error('Recaptcha Error:', error)\n  }\n\n  return (\n    <View>\n      <GoogleRecaptcha\n        ref={recaptchaRef}\n        baseUrl=\"http://localhost:3000\"\n        onError={handleError}\n        onVerify={handleVerify}\n        siteKey=\"6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI\"\n      />\n\n      <Button title=\"Send\" onPress={handleSend} />\n    </View>\n  )\n}\n```\n\nWith async `getToken()` method:\n\n```tsx\nimport React from 'react'\nimport { View, Button } from 'react-native'\n\nimport GoogleRecaptcha, {\n  GoogleRecaptchaSize,\n  GoogleRecaptchaToken,\n  GoogleRecaptchaRefAttributes\n} from 'react-native-google-recaptcha'\n\nconst App: React.FC = () => {\n  const recaptchaRef = React.useRef<GoogleRecaptchaRefAttributes>(null)\n\n  const handleSend = async () => {\n    try {\n      const token = await recaptchaRef.current?.getToken()\n\n      console.log('Recaptcha Token:', token)\n    } catch (e) {\n      console.error('Recaptcha Error:', e)\n    }\n  }\n\n  return (\n    <View>\n      <GoogleRecaptcha\n        ref={recaptchaRef}\n        // size={GoogleRecaptchaSize.INVISIBLE}\n        baseUrl=\"http://localhost:3000\"\n        siteKey=\"6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI\"\n      />\n\n      <Button title=\"Send\" onPress={handleSend} />\n    </View>\n  )\n}\n```\n\nFor more details, see the [Sample Project](https://github.com/bilaleren/react-native-google-recaptcha/blob/master/Example/App.tsx).\n\n## Test\n\n**Clone**\n\n```shell\ngit clone https://github.com/bilaleren/react-native-google-recaptcha.git\n```\n\n**Then**\n\n```shell\ncd react-native-google-recaptcha && yarn install && yarn lint && yarn test\n```\n\n## Props\n\nSee prop types [GoogleRecaptchaProps](https://github.com/bilaleren/react-native-google-recaptcha/blob/master/src/GoogleRecaptcha.tsx#L48)\n\n## Methods\n\nSee method types [GoogleRecaptchaRefAttributes](https://github.com/bilaleren/react-native-google-recaptcha/blob/master/src/GoogleRecaptcha.tsx#L22)\n\nNote: If using `size=\"invisible\"`, then challenge run automatically when `open` is called.\n\n## reCAPTCHA v2 docs\n\n- [I'm not a robot](https://developers.google.com/recaptcha/docs/display)\n- [Invisible](https://developers.google.com/recaptcha/docs/invisible)\n\n## reCAPTCHA Enterprise docs\n\n- [Overview](https://cloud.google.com/recaptcha-enterprise/docs/)\n- [Using features](https://cloud.google.com/recaptcha-enterprise/docs/using-features)\n\n## License\n\nThis project is licensed under the terms of the\n[MIT license](https://github.com/bilaleren/react-native-google-recaptcha/blob/master/LICENCE).\n","readmeFilename":"README.md"}