Skip to content

iOS Setup

Create an iOS mobile application key in Google Cloud reCAPTCHA. Register the bundle identifier used by your Capacitor app, then set the key in capacitor.config.ts.

iOS uses Google’s RecaptchaEnterprise mobile SDK. Regular, non-Enterprise reCAPTCHA v3 is only available on Web in this plugin; enterprise: false is rejected on iOS.

import type { CapacitorConfig } from '@capacitor/cli';
import '@capgo/capacitor-recaptcha';
const config: CapacitorConfig = {
plugins: {
Recaptcha: {
iosSiteKey: 'IOS_SITE_KEY',
},
},
};
export default config;

The plugin ships CocoaPods and Swift Package Manager metadata for Google’s RecaptchaEnterprise iOS SDK. Running npx cap sync ios installs the native dependency through your selected Capacitor iOS workflow.

import { Recaptcha } from '@capgo/capacitor-recaptcha';
const { token } = await Recaptcha.execute({
action: 'password_reset',
timeout: 10000,
});

Send the token to your backend immediately and create a reCAPTCHA assessment before accepting the protected request.

If you are using iOS Setup to plan authentication and account flows, connect it with Using @capgo/capacitor-recaptcha for the native capability in Using @capgo/capacitor-recaptcha, @capgo/capacitor-social-login for the implementation detail in @capgo/capacitor-social-login, @capgo/capacitor-passkey for the implementation detail in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric for the implementation detail in @capgo/capacitor-native-biometric, and Two-factor authentication for the implementation detail in Two-factor authentication.