npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@erickcrus/react-native-recaptcha

v0.1.10

Published

⚛ A lightweight new invisible recaptcha lib

Downloads

23

Readme

reCAPTCHA for React Native (Android and iOS)

A 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.

| Normal | Invisible | | - | - | | | |

Looking for React DOM version?

Install

Install the module

  npm i -S @erickcrus/react-native-recaptcha react-native-webview react-native-reanimated

See the react-native-webview Getting Started Guide. See the react-native-reanimated Getting Started Guide.

Usage

With JavaScript:

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

import Recaptcha from 'react-native-recaptcha';

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}
                hideBadge={true}
                hideLoader={true}
                siteKey="<your-recaptcha-public-key>"
                baseUrl="http://my.domain.com"
                onVerify={onVerify}
                onExpire={onExpire}
                size="invisible"
            />
            <Button title="Send" onPress={send} />
        </View>
    );
}
import React, { useRef } from 'react';
import { View, Button } from 'react-native';

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

// ...

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

    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.| |webViewProps|WebViewProps||Override the WebView props.| |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.| |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.| |theme|'dark' or 'light'|'light'|The color theme of the widget.| |size|'invisible', 'normal' or 'compact'|'normal'|The size of the widget.| |siteKey|string||(Required) Your sitekey.| |hideBadge|boolean||(Opitional) Hide the google badge| |hideLoader|boolean||(Opitional) Hide the loading animation| |baseUrl|string||(Required) The URL (domain) configured in the reCAPTCHA setup. (ex. http://my.domain.com)| |lang|string||Language code.| |style|ViewStyle||Customize default style such as background color.| |enterprise|boolean|false| (Experimental) Use the new reCAPTCHA Enterprise API.|

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.

Donate

License

The MIT License (MIT)

Copyright (c) 2020 Douglas Nassif Roma Junior

See the full license file.