Skip to content

About

Haskkor/react-native-recaptchav3

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

react-native-recaptchav3

npm npm

React native component to use the invisible reCAPTCHA v3 from Google

https://www.google.com/recaptcha/intro/v3.html

Installation

npm install --save @haskkor/react-native-recaptchav3

or

yarn add @haskkor/react-native-recaptchav3

Demo

automatic retrybutton

Usage

Automatically get a captcha token:

import ReCaptchaV3 from '@haskkor/react-native-recaptchav3'

<ReCaptchaV3
  captchaDomain={'https://yourowndomainname.co.nz'}
  siteKey={'yourownsitekey'}
  onReceiveToken={(token: string) => Alert.alert('CAPTCHA', token)}/>

One could also use a trigger to request a new token using the reference of the component:

import ReCaptchaV3 from '@haskkor/react-native-recaptchav3'

<ReCaptchaV3
  ref={(ref: RecaptchaV3) => this._captchaRef = ref}
  captchaDomain={'https://yourowndomainname.co.nz'}
  siteKey={'yourownsitekey'}
  onReceiveToken={(token: string) => Alert.alert('CAPTCHA', token)}/>

<TouchableOpacity onPress={() => this._captchaRef.refreshToken()}>
  <Text>Retry</Text>
</TouchableOpacity>

Options

Key Description Default Required Type
captchaDomain Your url registered with Google reCAPTCHA None true string
onReceiveToken The callback used to get the captcha token from the component None true (captchaToken: string) => void
siteKey The site key provided by Google reCAPTCHA None true string

Contributing

Pull requests are welcome.

About

Haskkor/react-native-recaptchav3

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages