Getting Started
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-recaptcha`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/recaptcha/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
설치npm install @capgo/capacitor-recaptchanpx cap sync사이트 키를 구성하십시오
구글 클라우드 reCAPTCHA에서 플랫폼 키를 만들고 추가하십시오.Create platform keys in Google Cloud reCAPTCHA, then add them to capacitor.config.ts.
import type { CapacitorConfig } from '@capacitor/cli';import '@capgo/capacitor-recaptcha';
const config: CapacitorConfig = { appId: 'com.example.app', appName: 'Example', webDir: 'dist', plugins: { Recaptcha: { androidSiteKey: 'ANDROID_SITE_KEY', iosSiteKey: 'IOS_SITE_KEY', webSiteKey: 'WEB_SITE_KEY', enterprise: true, }, },};
export default config;androidSiteKey, iosSiteKey, 및 webSiteKey 공유된 것을 siteKey override합니다. 또한 환경에 따라 키가 의존하는 경우 siteKey 직접 load() 에 전달할 수 있습니다. execute() 또는
Generate A Token
Section titled “Generate A Token”import { Recaptcha } from '@capgo/capacitor-recaptcha';
const { token } = await Recaptcha.execute({ action: 'login',});
await fetch('/api/recaptcha-assessment', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ token, action: 'login' }),});execute() , load() 호출합니다. 클라이언트가 준비되지 않은 경우 자동으로 호출되므로 명시적 로드 단계는 선택 사항입니다.
웹 표준 reCAPTCHA v3
웹 표준 reCAPTCHA v3 섹션설정 enterprise: false 구글의 표준 웹 reCAPTCHA v3 스크립트를 로드합니다.
const { token } = await Recaptcha.execute({ siteKey: 'WEB_V3_SITE_KEY', enterprise: false, action: 'signup',});안드로이드와 iOS에서 구글의 네이티브 모바일 SDK 경로는 Enterprise/mobile 전용입니다. 네이티브 플랫폼에서 전달하는 것은 거부되므로 표준 웹 v3 키가 실수로 사용되지 않도록 합니다. enterprise: false 이동 노트
콜 옵션과 __CAPGO_KEEP_0__ config에서 sitekeyAndroid 이 플러그인은 옛 Cordova 옵션 별칭을 받습니다. sitekeyWeb 콜 옵션과 Capacitor config에서 sitekeyIos iOS로의 마이그레이션을 위한 별칭으로 사용합니다. 새로운 __CAPGO_KEEP_1__에 대해 __CAPGO_KEEP_0__의 설정 이름을 선호합니다. sitekeyIOS as iOS migration aliases. Prefer the Capacitor config names for new code.
시작하기
이러한 기능을 사용 중이라면시작하기 인증 및 계정 흐름을 계획하고 연결하려면 native capability을 위한 @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-recaptcha native capability을 위한 @capgo/capacitor-recaptcha implementation detail을 위한 @capgo/capacitor-social-login implementation detail을 위한 @capgo/capacitor-social-login implementation detail을 위한 @capgo/capacitor-passkey implementation detail을 위한 @capgo/capacitor-passkey capgo/capacitor-passkey 구현 세부 사항에 대해 @capgo/capacitor-native-biometric 구현 세부 사항에 대해 @capgo/capacitor-native-biometric, 및 두 단계 인증 구현 세부 사항에 대해 두 단계 인증.