Skip to content

Getting Started

GitHub
  1. 패키지를 설치하세요

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

    터미널 창
    bunx cap sync
  3. __CAPGO_KEEP_0__를 사용하는 기본 HTTPS 의존 파티 원본을 shim 및 직접 사용하는 원본으로 읽습니다.

    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 in capacitor.config.*.

  • origin: primary HTTPS relying-party origin used by the shim and direct API
  • domains: 추가 의존 파티 호스트 이름을 native config에 동기화하는 동안 패치합니다.
  • autoShim: __CAPGO_KEEP_0__ true 와 __CAPGO_KEEP_0__를 제어합니다. cap sync 자동 구성 Hook

당신을 위해 sync 패치가 있습니다.

당신을 위해 sync 패치가 있습니다.

당신이 실행할 때 bunx cap sync, 플러그인이 생성된 네이티브 호스트 프로젝트를 업데이트합니다:

  • iOS: 필요할 때 Xcode 권한과 associated domains 권한을 연결합니다.
  • Android: asset_statements 메타데이터와 생성된 리소스 사용하는 매니페스트

Hook은 여전히 당신의 웹사이트를 신뢰하는 파일을 호스팅해야합니다. 당신의 파일을 공개하지 않습니다.

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

플랫폼 가이드

플랫폼 가이드 섹션

Getting Started에서 계속

Getting Started에서 계속

Capgo를 사용하여 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의 구현 세부 정보를 사용하여 두 단계 인증 두 단계 인증의 구현 세부 정보를 사용하여