All Projects → douglasjunior → react-native-recaptcha-that-works

douglasjunior / react-native-recaptcha-that-works

Licence: MIT license
⚛ A reCAPTCHA bridge for React Native that works (Android and iOS)

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-native-recaptcha-that-works

Recaptcha
[In]visible ReCaptcha v2 for iOS
Stars: ✭ 208 (+131.11%)
Mutual labels:  recaptcha
simple-recaptcha-v3
🤖 This repository contains simple reCAPTCHA v3 integration for your Laravel application.
Stars: ✭ 25 (-72.22%)
Mutual labels:  recaptcha
mautic-recaptcha
This Plugin brings reCAPTCHA integration to mautic.
Stars: ✭ 43 (-52.22%)
Mutual labels:  recaptcha
react-grecaptcha
React.js Google reCAPTCHA v2 integration component.
Stars: ✭ 52 (-42.22%)
Mutual labels:  recaptcha
recaptcha2
Easy verifier for google reCAPTCHA version 2 for Node.js and Express.js
Stars: ✭ 48 (-46.67%)
Mutual labels:  recaptcha
gothic
🦇 Gothic is a user registration and authentication SWT/JWT microservice. It supports REST, gRPC, and gRPC Web API, reCAPTCHA & a variety of DBs with Gorm.
Stars: ✭ 65 (-27.78%)
Mutual labels:  recaptcha
Captcha solver
Universal python API to captcha solving services
Stars: ✭ 152 (+68.89%)
Mutual labels:  recaptcha
recaptcha-unpaid-labor
Make ReCaptcha's "I'm not a robot" text more accurate
Stars: ✭ 15 (-83.33%)
Mutual labels:  recaptcha
django-rest-framework-recaptcha
reCAPTCHA field for Django REST framework serializers
Stars: ✭ 24 (-73.33%)
Mutual labels:  recaptcha
Server-Captcha
Protect Your Server From Automated Bots With Captcha Now !
Stars: ✭ 18 (-80%)
Mutual labels:  recaptcha
PRRecaptchaBundle
Recaptcha v3 bundle for Symfony
Stars: ✭ 14 (-84.44%)
Mutual labels:  recaptcha
dcat-auth-captcha
Sliding captcha for dcat-admin auth / dcat-admin登陆 滑动验证插件 多平台支持
Stars: ✭ 38 (-57.78%)
Mutual labels:  recaptcha
CapMonsterCloud
a C# wrapper for CapMonster Cloud API
Stars: ✭ 17 (-81.11%)
Mutual labels:  recaptcha
Captchaharvester
Solve captchas yourself without having to pay for services like 2captcha for use in automated projects.
Stars: ✭ 217 (+141.11%)
Mutual labels:  recaptcha
m2.ReCaptcha
Magento2. Extension is integrate Google Recaptcha with your Magento2 store.
Stars: ✭ 31 (-65.56%)
Mutual labels:  recaptcha
Puppeteer Extra
💯 Teach puppeteer new tricks through plugins.
Stars: ✭ 3,397 (+3674.44%)
Mutual labels:  recaptcha
wp-recaptcha-integration
WordPress reCaptcha integration supporting Ninja Forms and Contact Form 7
Stars: ✭ 50 (-44.44%)
Mutual labels:  recaptcha
netlify-forms-formik
📝 Netlify Forms with Formik and ReCaptcha
Stars: ✭ 33 (-63.33%)
Mutual labels:  recaptcha
evileg-core
EVILEG Social Network Framework - Core (ESNF-C)
Stars: ✭ 17 (-81.11%)
Mutual labels:  recaptcha
grav-plugin-comments
Grav Comments Plugin
Stars: ✭ 52 (-42.22%)
Mutual labels:  recaptcha

reCAPTCHA for React Native (Android and iOS)

License MIT npm version npm downloads

A reCAPTCHA library for React Native (Android and iOS) that works.

Normal Invisible

Looking for React DOM version?

Install

Install the module

  yarn add react-native-recaptcha-that-works react-native-webview

Or

  npm i -S react-native-recaptcha-that-works react-native-webview

See the react-native-webview Getting Started Guide.

Usage

With JavaScript:

import React, { useRef } from 'react';
import { View, Button } from 'react-native';

import Recaptcha from 'react-native-recaptcha-that-works';

const App = () => {
    const recaptcha = useRef();

    const send = () => {
        console.log('send!');
        this.recaptcha.current.open();
    }

    const onVerify = token => {
        console.log('success!', token);
    }

    const onExpire = () => {
        console.warn('expired!');
    }

    return (
        <View>
            <Recaptcha
                ref={recaptcha}
                siteKey="<your-recaptcha-public-key>"
                baseUrl="http://my.domain.com"
                onVerify={onVerify}
                onExpire={onExpire}
                size="invisible"
            />
            <Button title="Send" onPress={send} />
        </View>
    );
}
Or with TypeScript:
import React, { useRef } from 'react';
import { View, Button } from 'react-native';

import Recaptcha, { RecaptchaHandles } from "react-native-recaptcha-that-works";

// ...

export const Component: React.FC = () => {
    const recaptcha = useRef<RecaptchaHandles>(null);

    const send = () => {
        console.log('send!');
        recaptcha.current?.open();
    };

    const onVerify = (token: string) => {
        console.log('success!', token);
    };

    const onExpire = () => {
        console.warn('expired!');
    }

    return (
        <View>
            <Recaptcha
                ref={recaptcha}
                siteKey="<your-recaptcha-public-key>"
                baseUrl="http://my.domain.com"
                onVerify={onVerify}
                onExpire={onExpire}
                size="invisible"
            />
            <Button title="Send" onPress={send} />
        </View>
    );
};

For more details, see the Sample Project or try the Online demo.

Props

Name Value Default Description
headerComponent React Element A component to render on top of Modal.
footerComponent React Element A component to render on bottom of Modal.
loadingComponent React Element A custom loading component.
style ViewStyle Customize default style such as background color.
modalProps ModalProps Override the Modal props.
webViewProps WebViewProps Override the WebView props.
lang string Language code.
siteKey string (Required) Your sitekey.
baseUrl string (Required) The URL (domain) configured in the reCAPTCHA setup. (ex. http://my.domain.com)
size 'invisible', 'normal' or 'compact' 'normal' The size of the widget.
theme 'dark' or 'light' 'light' The color theme of the widget.
onLoad function() A callback function, executed when the reCAPTCHA is ready to use.
onVerify function(token) (Required) A callback function, executed when the user submits a successful response. The reCAPTCHA response token is passed to your callback.
onExpire function() A callback function, executed when the reCAPTCHA response expires and the user needs to re-verify. Only works if the webview still open after onVerify has been called for a long time.
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.
onClose function() A callback function, executed when the Modal is closed.
enterprise boolean false (Experimental) Use the new reCAPTCHA Enterprise API.
recaptchaDomain string www.google.com The host name of the reCAPTCHA valid api. See detail.
gstaticDomain string www.gstatic.com Customize reCAPTCHA gstatic host.
hideBadge boolean false When size = 'invisible', you are allowed to hide the badge as long as you include the reCAPTCHA branding visibly in the user flow. See detail.

Note: If lang is not set, then device language is used.

Methods

Name Type Description
open function Open the reCAPTCHA Modal.
close function Close the reCAPTCHA Modal.

Note: If using size="invisible", then challenge run automatically when open is called.

reCAPTCHA v2 docs

reCAPTCHA Enterprise docs

Contribute

New features, bug fixes and improvements are welcome! For questions and suggestions, use the issues.

Become a Patron! Donate

License

The MIT License (MIT)

Copyright (c) 2020 Douglas Nassif Roma Junior

See the full license file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].