1.0.0 • Published 1 month ago

react-native-google-recaptcha-provider v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

react-native-google-recaptcha-provider

Google reCAPTCHA provider for react native projects

Installation

yarn add react-native-google-recaptcha-provider

Overview

react-native-google-recaptcha-provider is a library for integrating Google reCAPTCHA into React Native applications. It provides a convenient way to add and customize reCAPTCHA in your application to prevent spam and abuse.

Example

You can find a usage example here

Customization

The library provides various customization options such as specifying the size, theme, language, and action associated with the reCAPTCHA widget.

Method and Field Descriptions

GoogleRecaptchaProps

Prop NameTypeRequiredDescription
siteKeystringYesThe site key obtained from Google reCAPTCHA.
baseUrlstringYesThe base URL of the website where reCAPTCHA is being used.
onVerify(token: string) => voidYesCallback function invoked when reCAPTCHA token is successfully verified.
onExpire() => voidNoCallback function invoked when the reCAPTCHA token expires.
onError(error: any) => voidNoCallback function invoked when an error occurs during reCAPTCHA verification.
onClose() => voidNoCallback function invoked when the reCAPTCHA widget is closed without completing.
onLoad() => voidNoCallback function invoked when the WebView finishes loading the HTML content.
loadingComponentReactNodeNoA custom loading component to display while reCAPTCHA is loading.
webViewPropsOmit<WebViewProps, 'source' | 'style' | 'onMessage'>NoAdditional props to be passed to the underlying WebView component.
langstringNoThe language code to use for reCAPTCHA.
size'normal' | 'compact' | 'invisible'NoThe size of the reCAPTCHA widget. Possible values: 'normal', 'compact', 'invisible'. Default is 'normal'.
theme'light' | 'dark'NoThe theme of the reCAPTCHA widget. Possible values: 'light', 'dark'. Default is 'light'.
enterprisebooleanNoSpecifies whether to use the new reCAPTCHA Enterprise API. Default is false.
actionstringNoAn additional parameter for specifying the action name associated with the protected element.
recaptchaDomainstringNoThe domain of the reCAPTCHA service. Defaults to 'www.google.com'.
gstaticDomainstringNoThe domain of the Google static content. Defaults to 'www.gstatic.com'.
hideBadgebooleanNoSpecifies whether to hide the reCAPTCHA badge. Defaults to false.
styleStyleProp\<ViewStyle>NoThe style object or stylesheet for the root container of the component.

MIT


Made with create-react-native-library