0.0.3 • Published 2 years ago

@manojkanth/react-native-google-recaptchav3 v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

React-native-google-recaptchaV3

A react native component that use the invisible reCAPTCHA v3 from Google

Features

  • Pure JS.
  • Compatible with both iOS and Android.

Tech

Installation

npm i @manojkanth/react-native-google-recaptchav3
npm i react-native-webview

Example

Import this module:

import ReCaptchaComponent from '@manojkanth/react-native-google-recaptchav3';

Use as a component:

<ReCaptchaComponent
  ref={(ref) => this._recaptchRef = ref}
  captchaDomain={'https://yourowndomain.com'}
  siteKey={'sitekey'}
  onTokenReceived={(token) => Alert.alert('CAPTCHA', token)}/>

To get new token:

this._recaptchRef.refreshToken()
PropTypeOptionalDefaultDescription
siteKeyStringNOnoneThe site key provided by Google reCAPTCHA
onTokenReceivedFunctionNOnoneThis returns captcha token from the component
captchaDomainStringNOnoneThe url registered with Google reCAPTCHA

Development

Any suggestion is welcome.