Skip to content

Getting Started

GitHub

설치

설치

Capgo AI 도구에 다음 명령어를 사용하여 스킬을 추가하세요.

터미널 창
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-passkey` plugin in my project.

만약에 수동 설치를 원한다면, 다음 명령어를 실행하고 아래의 플랫폼에 따라 지시를 따르세요.

  1. 패키지 설치

    터미널 창
    bun add @capgo/capacitor-passkey
  2. 자연스러운 프로젝트 동기화

    터미널 창
    bunx cap sync
  3. 플러그인 설정에 추가하세요

    import type { CapacitorConfig } from '@capacitor/cli';
    const config: CapacitorConfig = {
    appId: 'app.capgo.passkey.example',
    appName: 'My App',
    webDir: 'dist',
    plugins: {
    CapacitorPasskey: {
    origin: 'https://signin.example.com',
    autoShim: true,
    domains: ['signin.example.com'],
    },
    },
    };
    export default config;
  4. 시동 시에 shim을 설치하세요

    import { CapacitorPasskey } from '@capgo/capacitor-passkey';
    await CapacitorPasskey.autoShimWebAuthn();
  5. 정상적인 WebAuthn 흐름을 유지하세요

    const registration = await navigator.credentials.create({
    publicKey: registrationOptions,
    });
    const authentication = await navigator.credentials.get({
    publicKey: requestOptions,
    });

플러그인 설정이 무엇을 하는지

플러그인 설정이 무엇을 하는지

설정은 plugins.CapacitorPasskey 에서 capacitor.config.*.

  • origin: shim이 사용하는 기본 HTTPS 의존성 원본 및 직접 API
  • domains: native config에 extra relying-party hostnames을 patch합니다.
  • autoShim: 기본값입니다. true and controls the native cap sync auto-configuration hook

When you run bunx cap sync, plugin은 generated native host project를 업데이트합니다:

  • iOS: associated domains entitlements와 Xcode entitlements wiring이 필요할 때
  • Android: asset_statements metadata와 manifest에 사용되는 generated resource

The hook은 여전히 website trust files를 host해야합니다.

  • https://your-domain/.well-known/apple-app-site-association
  • https://your-domain/.well-known/assetlinks.json

플랫폼 가이드

플랫폼 가이드 섹션

Getting Started에서 계속

Getting Started 섹션

Capacitor를 사용 중이라면 Getting Started 인증 및 계정 흐름을 계획하고 연결하세요. @capgo/capacitor-passkey를 사용하여 @capgo/capacitor-passkey의 원시 기능을 사용하여 @capgo/capacitor-social-login @capgo/capacitor-social-login의 구현 세부 정보 @capgo/capacitor-passkey @capgo/capacitor-passkey의 구현 세부 정보 @capgo/capacitor-native-biometric @capgo/capacitor-native-biometric의 구현 세부 정보 2단계 인증 2단계 인증의 구현 세부 정보