hCaptcha Library for React Native (both Android and iOS)

Usage no npm install needed!

<script type="module">
  import hcaptchaReactNativeHcaptcha from 'https://cdn.skypack.dev/@hcaptcha/react-native-hcaptcha';



hCaptcha wrapper for React Native (Android and iOS)


  1. Install package:
  • Using NPM npm install react-native-hcaptcha
  • Using Yarn yarn add react-native-hcaptcha
  1. 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.


  1. react-native-modal

  2. react-native-webview


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.


You can 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.


  • Replace api.js params with more flexible constructor.
  • Support rqdata and other hCaptcha Enterprise features.


MIT License. (C) 2021 hCaptcha.

Credits: Originally forked from xuho and filipepiresg's Google reCAPTCHA v2 work. (MIT license)