{"_id":"@brbtcoficial/react-native-recaptcha","name":"@brbtcoficial/react-native-recaptcha","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@brbtcoficial/react-native-recaptcha","version":"0.0.1","private":false,"license":"MIT","description":"⚛ A lightweight new invisible recaptcha lib","repository":{"type":"git","url":"git+https://github.com/erickcrus/react-native-recaptcha.git"},"main":"src","keywords":["react-native","ios","android","recaptcha"],"author":{"name":"Erick Crus","email":"erickcrus@brasilbitcoin.com.br","url":"http://brasilbitcoin.com.br"},"bugs":{"url":"https://github.com/erickcrus/react-native-recaptcha/issues"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"homepage":"https://github.com/erickcrus/react-native-recaptcha","peerDependencies":{"react":"*","react-native":"*","react-native-reanimated":"*","react-native-webview":"*"},"devDependencies":{"@babel/core":"^7.20.0","@babel/preset-env":"^7.20.0","@babel/runtime":"^7.20.0","@react-native-community/eslint-config":"^3.2.0","@tsconfig/react-native":"^2.0.3","@types/jest":"^29.2.1","@types/react":"^18.0.24","@types/react-test-renderer":"^18.0.0","babel-jest":"^29.2.1","eslint":"^8.19.0","jest":"^29.2.1","metro-react-native-babel-preset":"0.73.8","prettier":"^2.4.1","react":"18.2.0","react-native":"0.71.4","react-native-webview":"13.3.1","react-test-renderer":"18.2.0","typescript":"4.8.4"},"resolutions":{"@types/react":"*","@types/react-native":"*","@types/react-native-webview":"*","@types/react-native-reanimated":"*"},"_id":"@brbtcoficial/react-native-recaptcha@0.0.1","gitHead":"620229f9ee971eb45dd28aa37ce52996c42d803a","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-9ynU+w0OKffKr3UoS7yuhbWRjPDOlScaLvT5O1OcM8QU1cL9vCSJz0pbe9nIW74VNW85v6tiVTfxqcOaXT07kA==","shasum":"eba38392d3b71dbf2942796b9ae2d4b502f0cdfb","tarball":"https://registry.npmjs.org/@brbtcoficial/react-native-recaptcha/-/react-native-recaptcha-0.0.1.tgz","fileCount":9,"unpackedSize":26986,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2+BjKGjxBxL9bwXorN7aY5k0lP0QL2nuJqTjA3uvuxAiEAj8wcE1ac0DAU5y/qYn59Aap4DPbngYYEuKieGkMy/sA="}]},"_npmUser":{"name":"brbtcoficial","email":"erickcrus_@hotmail.com"},"directories":{},"maintainers":[{"name":"brbtcoficial","email":"erickcrus_@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-recaptcha_0.0.1_1726191688789_0.4634888500101373"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-13T01:41:28.687Z","0.0.1":"2024-09-13T01:41:29.095Z","modified":"2024-09-13T01:41:29.418Z"},"maintainers":[{"name":"brbtcoficial","email":"erickcrus_@hotmail.com"}],"description":"⚛ A lightweight new invisible recaptcha lib","homepage":"https://github.com/erickcrus/react-native-recaptcha","keywords":["react-native","ios","android","recaptcha"],"repository":{"type":"git","url":"git+https://github.com/erickcrus/react-native-recaptcha.git"},"author":{"name":"Erick Crus","email":"erickcrus@brasilbitcoin.com.br","url":"http://brasilbitcoin.com.br"},"bugs":{"url":"https://github.com/erickcrus/react-native-recaptcha/issues"},"license":"MIT","readme":"# reCAPTCHA for React Native (Android and iOS)\n\nA reCAPTCHA library for React Native (Android and iOS) that works. This lib was forked from react-native-recaptcha-that-works, but was fully rewrite for my use propouse.\n\n| Normal | Invisible |\n| - | - |\n| <img src='https://raw.githubusercontent.com/douglasjunior/react-native-recaptcha-that-works/master/screenshots/normal.gif' width='240' /> | <img src='https://raw.githubusercontent.com/douglasjunior/react-native-recaptcha-that-works/master/screenshots/invisible.gif' width='240' /> |\n\n_Looking for [React DOM version](https://github.com/douglasjunior/react-recaptcha-that-works)?_\n\n## Install \n\n### Install the module \n```bash\n  npm i -S @erickcrus/react-native-recaptcha react-native-webview react-native-reanimated\n```\n\n_See the [`react-native-webview` Getting Started Guide](https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md)._\n_See the [`react-native-reanimated` Getting Started Guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started)._\n\n## Usage\n\nWith <strong>JavaScript</strong>:\n\n```jsx\nimport React, { useRef } from 'react';\nimport { View, Button } from 'react-native';\n\nimport Recaptcha from 'react-native-recaptcha';\n\nconst App = () => {\n    const recaptcha = useRef();\n\n    const send = () => {\n        console.log('send!');\n        this.recaptcha.current.open();\n    }\n\n    const onVerify = token => {\n        console.log('success!', token);\n    }\n\n    const onExpire = () => {\n        console.warn('expired!');\n    }\n\n    return (\n        <View>\n            <Recaptcha\n                ref={recaptcha}\n                hideBadge={true}\n                hideLoader={true}\n                siteKey=\"<your-recaptcha-public-key>\"\n                baseUrl=\"http://my.domain.com\"\n                onVerify={onVerify}\n                onExpire={onExpire}\n                size=\"invisible\"\n            />\n            <Button title=\"Send\" onPress={send} />\n        </View>\n    );\n}\n```\n\n<details>\n    <summary>Or with <strong>TypeScript</strong>:</summary>\n  \n```tsx\nimport React, { useRef } from 'react';\nimport { View, Button } from 'react-native';\n\nimport Recaptcha, { RecaptchaHandles } from \"react-native-recaptcha\";\n\n// ...\n\nexport const Component: React.FC = () => {\n    const recaptcha = useRef<RecaptchaHandles>();\n\n    const send = () => {\n        console.log('send!');\n        recaptcha.current?.open();\n    };\n\n    const onVerify = (token: string) => {\n        console.log('success!', token);\n    };\n\n    const onExpire = () => {\n        console.warn('expired!');\n    }\n\n    return (\n        <View>\n            <Recaptcha\n                ref={recaptcha}\n                siteKey=\"<your-recaptcha-public-key>\"\n                baseUrl=\"http://my.domain.com\"\n                onVerify={onVerify}\n                onExpire={onExpire}\n                size=\"invisible\"\n            />\n            <Button title=\"Send\" onPress={send} />\n        </View>\n    );\n};\n```\n</details>\n\n<br />\n\nFor more details, see the [Sample Project](https://github.com/douglasjunior/react-native-recaptcha-that-works/blob/master/Sample/src/App.js) or try the [Online demo](https://snack.expo.dev/@douglasjunior/react-native-recaptcha-that-works).\n\n## Props\n\n|Name|Value|Default|Description|\n|-|-|-|-|\n|headerComponent|`React Element`||A component to render on top of Modal.|\n|footerComponent|`React Element`||A component to render on bottom of Modal.|\n|loadingComponent|`React Element`||A custom loading component.|\n|webViewProps|[WebViewProps](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Reference.md)||Override the WebView props.|\n|onVerify|`function(token)`||(Required) A callback function, executed when the user submits a successful response. The reCAPTCHA response token is passed to your callback.|\n|onExpire|`function()`||A callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.|\n|onError|`function(error)`||A callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry.|\n|onClose|`function()`|| A callback function, executed when the Modal is closed.|\n|theme|`'dark'` or `'light'`|`'light'`|The color theme of the widget.|\n|size|`'invisible'`, `'normal'` or `'compact'`|`'normal'`|The size of the widget.|\n|siteKey|`string`||(Required) Your sitekey.|\n|hideBadge|`boolean`||(Opitional) Hide the google badge|\n|hideLoader|`boolean`||(Opitional) Hide the loading animation|\n|baseUrl|`string`||(Required) The URL (domain) configured in the reCAPTCHA setup. (ex. http://my.domain.com)|\n|lang|`string`||[Language code](https://developers.google.com/recaptcha/docs/language).|\n|style|[`ViewStyle`](https://reactnative.dev/docs/view-style-props)||Customize default style such as background color.|\n|enterprise|`boolean`|`false`| (Experimental) Use the new [reCAPTCHA Enterprise API](https://cloud.google.com/recaptcha-enterprise/docs/using-features).|\n\nNote: If `lang` is not set, then device language is used.\n\n## Methods\n\n|Name|Type|Description|\n|-|-|-|\n|open|`function`|Open the reCAPTCHA Modal.|\n|close|`function`|Close the reCAPTCHA Modal.|\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## Contribute\n\nNew features, bug fixes and improvements are welcome! For questions and suggestions, use the [issues](https://github.com/douglasjunior/react-native-recaptcha-that-works/issues).\n\n<a href=\"https://www.patreon.com/douglasjunior\"><img src=\"http://i.imgur.com/xEO164Z.png\" alt=\"Become a Patron!\" width=\"200\" /></a>\n[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E32BUP77SVBA2)\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2020 Douglas Nassif Roma Junior\n```\n\nSee the full [license file](https://github.com/douglasjunior/react-native-recaptcha-that-works/blob/master/LICENSE).\n","readmeFilename":"README.md"}