🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@captchafox/react-native

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@captchafox/react-native

React Native SDK

1.0.1
latest
Source
npm
Version published
Weekly downloads
2
-33.33%
Maintainers
2
Weekly downloads
 
Created
Source

@captchafox/react-native

NPM version

Installation

Install the library using your prefered package manager

npm install @captchafox/react-native
yarn add @captchafox/react-native
pnpm add @captchafox/react-native

Follow the steps 1 and 2 of the react-native-webview Getting Started Guide.

Usage

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

import { CaptchaFoxModal, CaptchaFoxModalRef } from '@captchafox/react-native';

function Example() {
  const captchaRef = useRef<CaptchaFoxModalRef>(null);

  const submit = () => {
    captchaRef?.current?.show();
  }

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

  const onError = (error) => {
    console.error('Error:', error)
  }

  return (
    <View>
      <CaptchaFoxModal
        ref={captchaRef}
        baseUrl="https://YOUR_DOMAIN"
        siteKey="YOUR_SITE_KEY"
        onVerify={onVerify}
        onError={onError}
      />
      <Button
        title="Submit"
        onPress={submit}
      />
    </View>
  );
}

For more details, see the Example Project.

Props

PropTypeDescriptionRequired
siteKeystringThe sitekey for the widget
baseUrlstringThe base URL that is used for the WebView.
langstringThe language the widget should display. Defaults to automatically detecting it.
modeinline|popup|hiddenThe mode the widget should be displayed in .
themelight | darkThe theme of the widget. Defaults to light.
backdropColorstringColor of the modal backdrop.
modalStyleStyleCustom modal style.
loadingComponentReactNodeCustom modal loading indicator.
headerComponentReactNodeCustom modal header.
footerComponentReactNodeCustom modal footer.
onVerifyfunctionCalled with the response token after successful verification.
onFailfunctionCalled after unsuccessful verification.
onErrorfunctionCalled when an error occured.
onExpirefunctionCalled when the challenge expires.
onClosefunctionCalled when the challenge was closed.
onErrorfunctionCalled when an error occured.
onLoadfunctionCalled after the widget has been loaded.

Methods

NameTypeDescription
showfunctionShow the CaptchaFox Modal.
hidefunctionHide the CaptchaFox Modal.

Customizing

The package exports the base CaptchaFox component to allow using it directly or creating custom modal screens. This base component is used in the CaptchaFoxModal with a React Native Modal around it.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Keywords

react-native

FAQs

Package last updated on 22 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts