iOS-Einrichtung
Zugehörige Domänen und apple-app-site-association.
Einen Einrichtungsprompt mit den Installationsanweisungen und der vollständigen Markdown-Guideline 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 Bootstrapping
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: primäre HTTPS-Anbieter-Quelle, die vom Shim und dem direkten API verwendet wirddomains: zusätzliche Anbieter-Hostnamen, die in die native Konfiguration während der Synchronisierung eingepflegt werdenautoShim: standardmäßig true und steuert die native cap sync AutomatisierungshookWenn Sie das Kommando ausführen bunx cap syncwird der Plugin die generierte native Host-Projekt aktualisiert:
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.json