Skip to content

시작하기

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

당신을 위해 __CAPGO_KEEP_0__를 동기화합니다.

당신을 위해 __CAPGO_KEEP_0__를 동기화하는 방법

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

  • iOS: 필요할 때 Xcode 권한과 관련된 도메인 권한
  • Android: __CAPGO_KEEP_0__와 생성된 리소스 사용하는 __CAPGO_KEEP_1__ asset_statements __CAPGO_KEEP_0__ Hook은 당신의 웹사이트 신뢰 파일을 공개하지 않습니다. 당신은 여전히 __CAPGO_KEEP_2__해야합니다.

플랫폼 가이드

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