Pengaturan iOS
Domain terkait dan apple-app-site-association.
Copy prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-passkey`
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/passkey/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.
Pasang paket
bun add @capgo/capacitor-passkeySinkronkan proyek native
bunx cap syncTambahkan konfigurasi plugin
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;Pasang shim selama proses bootstrapping
import { CapacitorPasskey } from '@capgo/capacitor-passkey';
await CapacitorPasskey.autoShimWebAuthn();Tetapkan alur WebAuthn normal Anda
const registration = await navigator.credentials.create({ publicKey: registrationOptions,});
const authentication = await navigator.credentials.get({ publicKey: requestOptions,});Konfigurasi dibaca dari plugins.CapacitorPasskey di capacitor.config.*.
origin: asal HTTPS utama RP yang digunakan oleh shim dan langsung APIdomains: hostname RP tambahan untuk memperbaiki ke konfigurasi native selama sinkronisasiautoShimmenggunakan nilai default true dan mengontrol pengaturan asli cap sync hook konfigurasi otomatisSaat Anda menjalankan bunx cap sync, plugin ini memperbarui proyek host native yang dihasilkan:
asset_statements metadata dan sumber daya yang dihasilkan yang digunakan oleh manifestHook ini tidak memublikasikan file kepercayaan situs web Anda. Anda masih perlu menampung:
https://your-domain/.well-known/apple-app-site-associationhttps://your-domain/.well-known/assetlinks.json