Skip to content

はじめから

GitHub

AI-Assisted セットアップを使用してプラグインをインストールできます。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-passkey` plugin in my project.

Manual Setupを使用する場合は、以下のコマンドを実行してください。以下のプラットフォーム固有の指示に従ってください。

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

  • origin: primary HTTPS relying-party origin used by the shim and direct API
  • domains: プラグイン設定で修正する追加の依存関係ホスト名
  • autoShim: デフォルトは true と、ネイティブの cap sync 自動構成のハック

あなたのためにsyncパッチをsyncします

あなたのためにsyncパッチをsyncします

あなたが実行するとき bunx cap sync、プラグインは生成されたネイティブホストプロジェクトを更新します:

  • iOS: 必要に応じて関連付けられたドメインの特権とXcodeの特権のワイヤリング
  • Android: asset_statements メタデータと生成されたリソースがマニフェストに使用される

ハックはあなたのウェブサイトの信頼ファイルを公開しません。まだホストする必要があります:

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

プラットフォームガイド

iOSの設定

「Getting Started」から続けてください

「Getting Started」から続けてください

「Getting Started」を使用している場合 「Getting Started」を使用して 認証とアカウントフローの計画に使用し、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-passkey を@capgo/capacitor-passkey for the native capability in Using @capgo/capacitor-passkey, @capgo/capacitor-social-login for the implementation detail in @capgo/capacitor-social-login, @capgo/capacitor-passkey for the implementation detail in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric for the implementation detail in @capgo/capacitor-native-biometric, and 2要素認証 2要素認証の実装詳細について