ガイド
reCAPTCHA のチュートリアル
@capgo/capacitor-recaptcha を使用
Generate reCAPTCHA and reCAPTCHA Enterprise tokens from Web, Android, and iOS Capacitor apps.
インストール
npm install @capgo/capacitor-recaptcha
npx cap sync
設定
import type { CapacitorConfig } from '@capacitor/cli';
import '@capgo/capacitor-recaptcha';
const config: CapacitorConfig = {
plugins: {
Recaptcha: {
androidSiteKey: 'ANDROID_SITE_KEY',
iosSiteKey: 'IOS_SITE_KEY',
webSiteKey: 'WEB_SITE_KEY',
enterprise: true,
},
},
};
export default config;
使用 enterprise: false only when the Web implementation should load standard reCAPTCHA v3 instead of reCAPTCHA Enterprise. Android and iOS use Google's Enterprise/mobile SDK path and reject enterprise: false.
トークンを生成
import { Recaptcha } from '@capgo/capacitor-recaptcha';
const { token } = await Recaptcha.execute({
action: 'login',
});
トークンをバックエンドに送信し、保護されたリクエストを受け入れる前にreCAPTCHAの評価を実行してください。
フルリファレンス
- GitHub: https://github.com/Cap-go/capacitor-recaptcha/
- ドキュメント: /docs/plugins/recaptcha/
capgoから続けて使用する@capgo/capacitor-recaptcha
Capacitor reCAPTCHAを使用している場合 Using @capgo/capacitor-recaptcha 認証とアカウントフローの計画、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-recaptchaに接続する @capgo/capacitor-recaptcha @capgo/capacitor-recaptchaの実装詳細 Getting Started Getting Startedの実装詳細 @capgo/capacitor-social-login @capgo/capacitor-social-loginの実装詳細 @capgo/capacitor-passkey @capgo/capacitor-passkeyの実装詳細 @capgo/capacitor-native-biometric @capgo/capacitor-native-biometricの実装詳細