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.
설치
설치 제목AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 기능을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그런 다음 다음 프롬프트를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-recaptcha` plugin in my project.만들기 옵션을 선택하신 경우, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르십시오:
bun add @capgo/capacitor-recaptchabunx cap sync사이트 키 구성
사이트 키 구성 섹션Google Cloud reCAPTCHA에서 플랫폼 키를 생성하고 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를 오버라이드하십시오. siteKey 또한 load() or execute() 환경에 따라 키가 달라질 때.
토큰 생성
토큰 생성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 Google의 표준 웹 reCAPTCHA v3 스크립트를 로드합니다.
const { token } = await Recaptcha.execute({ siteKey: 'WEB_V3_SITE_KEY', enterprise: false, action: 'signup',});Android 및 iOS에서 Google의 네이티브 모바일 SDK 경로는 Enterprise/mobile 전용입니다. Passing enterprise: false 원래 플랫폼에서 native 플러그인을 사용하는 경우, 표준 웹 v3 키가 의도치 않게 사용되지 않습니다.
이동 노트
이동 노트이 플러그인은 Cordova 옵션의 이전 이름을 사용합니다. sitekeyAndroid 그리고 sitekeyWeb 호출 옵션 및 Capacitor 구성에서도 사용합니다. 또한 iOS 마이그레이션 이름을 사용합니다. sitekeyIos 그리고 sitekeyIOS code을 사용하는 새로운 Capacitor 구성 이름을 선호합니다.
시작하기
시작하기시작하기 시작하기 인증 및 계정 흐름을 계획하고 연결하려면 @capgo/capacitor-recaptcha Using @capgo/capacitor-recaptcha @capgo/capacitor-social-login @capgo/capacitor-social-login @capgo/capacitor-passkey @capgo/capacitor-passkey capgo/capacitor-native-biometric @capgo/capacitor-native-biometric 두 단계 인증 두 단계 인증