hCaptcha wrapper for React Native (Android and iOS)
- Install package:
- Using NPM
npm install react-native-hcaptcha
- Using Yarn
yarn add react-native-hcaptcha
- Import package:
import ConfirmHcaptcha from '@hcaptcha/react-native-hcaptcha';
See live demo in Snack.
See Example.App.js example in repo for a fully worked example implementation.
Make sure the value you pass to
languageCode is the one the user has set in your app if you allow them to override the system defaults.
Otherwise, you should pass in the preferred device locale, e.g. fetched from
getLocales() if using react-native-localize.
import Hcaptcha from '@hcaptcha/react-native-hcaptcha/Hcaptcha'; to customize the UI yourself.
siteKey(String) - The hCaptcha sitekey
baseUrl(String) The url domain defined on your hCaptcha. You generally will not need to change this.
onMessage(Function) - The callback function that runs after receiving a response, error, or when user cancels.
languageCode(String) - Default language for hCaptcha. Overrides phone defaults. A complete list of supported languages and their codes can be found at this link
Fully functional, but additional releases will be made in the near term. Changes within the same major release are expected to be additive, i.e. non-breaking.
api.jsparams with more flexible constructor.
rqdataand other hCaptcha Enterprise features.
MIT License. (C) 2021 hCaptcha.
Credits: Originally forked from xuho and filipepiresg's Google reCAPTCHA v2 work. (MIT license)