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 bootstrap
import { CapacitorPasskey } from '@capgo/capacitor-passkey';
await CapacitorPasskey.autoShimWebAuthn();Tetapkan aliran 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 pihak ketiga utama yang digunakan oleh shim dan APIdomains: nama host pihak ketiga tambahan untuk memperbaiki ke dalam konfigurasi asli selama sinkronisasiautoShim: default ke true dan mengontrol hook konfigurasi asli cap sync Auto-configuration hookKetika Anda menjalankan bunx cap syncplugin 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 menyiapkan:
https://your-domain/.well-known/apple-app-site-associationhttps://your-domain/.well-known/assetlinks.json