iOS setup
Associated Domains and apple-app-site-association.
Ce contenu n'est pas encore disponible dans votre langue.
Install the package
bun add @capgo/capacitor-passkeySync native projects
bunx cap syncAdd the plugin config
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;Import the shim once
import '@capgo/capacitor-passkey/auto';Keep your normal WebAuthn flow
const registration = await navigator.credentials.create({ publicKey: registrationOptions,});
const authentication = await navigator.credentials.get({ publicKey: requestOptions,});The config is read from plugins.CapacitorPasskey in capacitor.config.*.
origin: primary HTTPS relying-party origin used by the shim and direct APIdomains: extra relying-party hostnames to patch into native config during syncautoShim: defaults to true when you use @capgo/capacitor-passkey/autoWhen you run bunx cap sync, the plugin updates the generated native host project:
asset_statements metadata and the generated resource used by the manifestThe hook does not publish your website trust files for you. You still need to host:
https://your-domain/.well-known/apple-app-site-associationhttps://your-domain/.well-known/assetlinks.json