시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
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-Assisted Setup으로 플러그인을 설치할 수 있습니다. 다음 명령어로 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.수동 설정을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
-
패키지 설치
터미널 창 bun add @capgo/capacitor-app-attest -
네이티브 프로젝트 동기화
터미널 창 bunx cap sync -
플랫폼 요구 사항 설정
- 전체 iOS 설정 App Attest 기능 및 백엔드 검증 플로우를 위해.
- 전체 Android 설정 Play Integrity Standard 및 백엔드 검증 플로우를 위해.
빠른 시작
“빠른 시작” 섹션import { AppAttest } from '@capgo/capacitor-app-attest';
const support = await AppAttest.isSupported();if (!support.isSupported) throw new Error('Attestation unavailable');
const prepared = await AppAttest.prepare();const attestation = await AppAttest.createAttestation({ keyId: prepared.keyId, challenge: serverNonce,});await sendAttestationToBackend(attestation);예: 인증된 요청 확인
“예시: 인증된 요청 검증하기” 섹션const assertion = await AppAttest.createAssertion({ keyId: storedKeyId, payload: requestHash,});자주 하는 실수
“흔한 실수” 섹션- 백엔드 검증 필수: 기기 내의 attestation blob만 믿지 말고, 반드시 서버에서 검증하세요.
- Play Integrity 프로젝트 번호: Android Standard API는 README에 있는 Google Cloud 프로젝트 번호가 필요합니다.
- 키 저장: 사용
storeKeyId()로그아웃할 때 삭제해 오래된 키가 남지 않도록 하세요.
이 플러그인을 사용하는 이유
“이 플러그인을 사용하는 이유” 섹션이 플러그인은 네이티브 플랫폼 보안을 유지하면서 단일 크로스플랫폼 API를 제공합니다:
- iOS: Apple App Attest (
DeviceCheck) - Android: Google Play Integrity Standard API
- 커스텀 클라이언트 측 암호화 방식 불필요
- 백엔드 검증을 위한 정규화된 출력값
사용량
“Usage” 섹션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 | 백엔드에서 검증할 토큰 |
백엔드 요구사항
“백엔드 요구 사항” 섹션Attestation은 서버 측에서 검증할 때만 유용합니다.
- 클라이언트만 성공했다고 신뢰하지 마세요.
- 백엔드에서 일회용 challenge/payload 값을 받도록 하세요.
- 검증
token, 앱 식별 및 재전송 방지를 백엔드 로직에서 검증하세요.
플랫폼별 백엔드 가이드를 참고하세요:
시작하기 다음 단계
“Getting Started에서 계속하기” 섹션사용 중이라면 시작하기 보안 및 컴플라이언스 계획을 세우려면, 다음 항목과 연결하세요: @capgo/capacitor-app-attest 사용하기 @capgo/capacitor-app-attest 사용 시 네이티브 기능을 위해, 암호화 암호화 구현 상세 정보: 컴플라이언스 컴플라이언스 구현 상세 정보: Capgo 보안 스캐너 Capgo Security Scanner에서 제품 워크플로우는, 그리고 Capgo 보안 Capgo Security의 제품 워크플로를 위해.