
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@google-cloud/recaptcha-enterprise-react-native
Advanced tools
React Native plugin for reCAPTCHA Enterprise Mobile SDK
Please note that issues filed in this repository are not an official Google support channel and are answered on a best effort basis. For official support, please visit: https://cloud.google.com/support-hub.
If you have an issue with the React Native plugin please post issues in this repository. If you are having issues with the underlying SDK, please post issues in https://github.com/GoogleCloudPlatform/recaptcha-enterprise-mobile-sdk.
For general documentation on reCAPTCHA Enterprise for mobile applications, see Android and iOS.
Add the package to your React Native project:
npx yarn add @google-cloud/recaptcha-enterprise-react-native
If using VSCode install eslint:
https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
You may need to use an older JDK:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-19-latest/Contents/Home
Similar to Firebase, the library requires frameworks and static linkage:
use_frameworks! :linkage => :static
And flipper is not compatible with static linkage so disable flipper in the Podfile:
flipper_config = FlipperConfiguration.disabled
This section shows how to integrate with reCAPTCHA SDK.
Use the following imports to access the APIs provided by the SDK.
import {
Recaptcha,
RecaptchaAction,
type RecaptchaClient,
} from '@google-cloud/recaptcha-enterprise-react-native';
Instantiate a client by using the reCAPTCHA key (KEY_ID) that you created for your Android/iOS app.
const client = await Recaptcha.fetchClient(SITE_KEY);
[!NOTE] You must initialize the reCAPTCHA client only once during the lifetime of your app.
For each action of your app that is protected using reCAPTCHA, call the execute method passing a
RecaptchaAction
. reCAPTCHA provides a built-in set of actions and if necessary you can create
custom actions.
The following code snippet shows how to use execute to protect a LOGIN
action.
const token = await client.execute(RecaptchaAction.LOGIN());
In case a custom action use RecaptchaAction.custom('ACTION')
;
Follow guidance at Example App.
error: include of non-modular header inside framework module 'RecaptchaEnterprise.Recaptcha'
Use static linking in pods, for instance: USE_FRAMEWORKS=static pod install
or
use_frameworks! :linkage => :static
in your Podfile.
<FlipperKit/FlipperClient.h>`
Flipper is not yet compatible with static linkage, so disable flipper in your
Podfile: flipper_config = FlipperConfiguration.disabled
Run the following command in the terminal:
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
This happens when a unsupported Java version is used. Run
npx react-native doctor
To discover the version that's being used and the supported ones. Change the version of Java to a supported one and try again.
18.7.1
FAQs
React Native plugin for reCAPTCHA Enterprise Mobile SDK
The npm package @google-cloud/recaptcha-enterprise-react-native receives a total of 10,652 weekly downloads. As such, @google-cloud/recaptcha-enterprise-react-native popularity was classified as popular.
We found that @google-cloud/recaptcha-enterprise-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.