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.
-
パッケージをインストール
ターミナル画面 bun add @capgo/capacitor-app-attest -
ネイティブプロジェクトを同期
ターミナル画面 bunx cap sync -
プラットフォーム要件を設定
このプラグインを使用する理由
「このプラグインを使用する理由」というセクションこのプラグインは、ネイティブプラットフォームのセキュリティを維持しながら、1つのクロスプラットフォームAPIを提供します。
- iOS: Apple App Attest (
DeviceCheck) - Android: Google Play Integrity StandardAPI
- カスタムクライアントサイド暗号化スキームなし
- バックエンドチェック用に標準化された出力
使用方法
「使用方法」というセクション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
バックエンド要件のセクション証明はサーバー側で検証された場合にのみ有効です。
- クライアントのみの成功は信頼できません。
- バックエンドから一時的なチャレンジ/ペイロード値を要求してください。
- バックエンドのロジックでアプリのアイデンティティとリプレイ保護を検証してください。
tokenプラットフォーム固有のバックエンドガイドを使用してください:
iOSのセットアップとバックエンドの検証
Getting Startedから続けてくださいのセクション
Capgoを使用している場合If you are using スタート __CAPGO_KEEP_0__をセキュリティとコンプライアンスの計画に接続する capgo/capacitor-app-attestを使用する capgo/capacitor-app-attestのネイティブ機能について 暗号化 暗号化の実装詳細について コンプライアンス コンプライアンスの実装詳細について Capgo セキュリティ スキャナー Capgo セキュリティ スキャナーの製品ワークフローについて Capgo セキュリティ Capgo セキュリティの製品ワークフローについて