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-app-attest`
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/app-attest/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アシストされたセットアップを使用してプラグインをインストールできます。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-app-attest` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行してプラットフォーム固有の指示に従ってください:
-
パッケージをインストール
ターミナル画面 bun add @capgo/capacitor-app-attest -
ネイティブプロジェクトを同期
ターミナル画面 bunx cap sync -
プラットフォームの要件を設定
- 完了 iOS セットアップ iOS用のApp Attest機能とバックエンド検証フローのための設定です。
- 完了 Android セットアップ Play Integrity Standardとバックエンド検証フローのためのAndroid用の設定です。
このプラグインを使用する理由
このプラグインの使用理由のセクションこのプラグインは、ネイティブプラットフォームのセキュリティを維持しながら、1つのクロスプラットフォーム API を提供します。
- iOS: Apple App Attest (
DeviceCheck) - Android: Google Play Integrity Standard API
- カスタムクライアントサイド暗号化スキームなし
- バックエンドチェック用の標準化された出力
使用方法
セクション:使用方法import { AppAttest } from '@capgo/capacitor-app-attest';
const support = await AppAttest.isSupported();if (!support.isSupported) { throw new Error(`Attestation not supported on ${support.platform}`);}
const prepared = await AppAttest.prepare();
const registration = await AppAttest.createAttestation({ keyId: prepared.keyId, challenge: 'backend-one-time-registration-challenge',});
const assertion = await AppAttest.createAssertion({ keyId: prepared.keyId, payload: 'backend-one-time-request-payload',});
console.log(registration.platform, registration.format, registration.token);console.log(assertion.platform, assertion.format, assertion.token);統一されたレスポンス形状
セクション:統一されたレスポンス形状createAttestation() そして createAssertion() iOSとAndroidで同じキーフィールドを返します:
| フィールド | タイプ | 説明 |
|---|---|---|
platform | 'ios' | 'android' | 'web' | ネイティブプラットフォームでトークンを生成したもの |
format | AttestationFormat | apple-app-attest または google-play-integrity-standard |
keyId | string | 証明のためのキー/プロバイダハンドル |
token | string | __CAPGO_KEEP_0__をバックエンドで検証するためのトークン |
バックエンドの要件
バックエンドの要件証明はサーバー側で検証されていないと役に立たない。
- クライアントのみの成功は信頼できない。
- バックエンドから一時的なチャレンジ/ペイロード値を要求する。
- 検証
tokenアプリケーションID、そしてバックエンドロジック内でのリプレイ保護を使用する。
プラットフォーム固有のバックエンドガイドを使用してください:
Getting Startedから続けてください
Getting Startedから続けてくださいのセクションCapgoを使用している場合 Getting Started セキュリティとコンプライアンスを計画するには、Capgoを @capgo/capacitor-app-attestを使用 @capgo/capacitor-app-attestのネイティブ機能 暗号化 暗号化の実装詳細 コンプライアンス コンプライアンスの実装詳細 Capgo セキュリティ スキャナー 製品ワークフローにおけるCapgo セキュリティ スキャナの機能について Capgo セキュリティ 製品ワークフローにおけるCapgo セキュリティの機能について