iOS-Einrichtung
zugehörige Domains und apple-app-site-association.
Eine Setup-Vorlage mit den Installationsanweisungen und der vollständigen Markdown-Dokumentation für diesen Plugin kopieren.
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.
Installieren Sie das Paket
bun add @capgo/capacitor-passkeySynchronisieren Sie native Projekte
bunx cap syncFügen Sie die Plugin-Konfiguration hinzu
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;Installieren Sie den Shim während des Bootstraps
import { CapacitorPasskey } from '@capgo/capacitor-passkey';
await CapacitorPasskey.autoShimWebAuthn();Halten Sie Ihren normalen WebAuthn-Flow aufrecht
const registration = await navigator.credentials.create({ publicKey: registrationOptions,});
const authentication = await navigator.credentials.get({ publicKey: requestOptions,});Die Konfiguration wird aus plugins.CapacitorPasskey in capacitor.config.*.
origin: der primäre HTTPS-Vertrauenspartner- Ursprung, der vom Shim und direkt verwendet wird APIdomains: zusätzliche Vertrauenspartner-Hostnamen, die in die native Konfiguration während des Synchronisierens eingepflegt werdenautoShimdefaults zu true und steuert die native cap sync Auto-Konfigurations-HookWenn Sie das Skript ausführen bunx cap sync, aktualisiert das Plugin den generierten native Host-Projekt:
asset_statements Metadaten und die generierte Ressource, die vom Manifest verwendet wirdDer Hook veröffentlicht Ihre Website-Trust-Dateien nicht für Sie. Sie müssen sie noch selbst hosten:
https://your-domain/.well-known/apple-app-site-associationhttps://your-domain/.well-known/assetlinks.jsoniOS-Einrichtung
zugehörige Domains und apple-app-site-association.
Android-Einrichtung
Digitale Asset-Links und assetlinks.json.
Hinweise zum Backend
Überprüfung der Ursprungs-URL und Android-Hinweise.
Wenn Sie Getting Started zur Planung der Authentifizierung und der Kontoflows verwenden, verbinden Sie es mit Mit @capgo/capacitor-passkey für die native Fähigkeit in Mit @capgo/capacitor-passkey, @capgo/capacitor-social-login für die Implementierungsdetails in @capgo/capacitor-social-login, @capgo/capacitor-passkey für die Implementierungsdetails in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric für die Implementierungsdetails in @capgo/capacitor-native-biometric, und Zwei-Faktor-Authentifizierung für die Implementierungsdetails in Zwei-Faktor-Authentifizierung.