跳过内容

@capgo/capacitor-passkey

将您的浏览器样式的 WebAuthn code 在一个 Capacitor 应用程序中保留,而插件处理本机 passkey 调用和本机主机补丁。

Browser-style API

保留 navigator.credentials.create() 在您的应用程序中代替重写您的 passkey 流程以适应一个自定义 __CAPGO_KEEP_0__。 navigator.credentials.get() in your app instead of rewriting your passkey flow around a custom API.

只需添加一次插件配置,调用

Minimal app changes: Add plugin config once, call CapacitorPasskey.autoShimWebAuthn() 在引导期间,保持您的 WebAuthn code 与浏览器实现尽可能接近。

编译时本机编程

插件在同步期间修补生成的 iOS 和 Android 主机项目,因此您不需要手动编辑这些文件。

  • shimWebAuthn(options?) __CAPGO_KEEP_0__
  • getConfiguration() 立即安装浏览器样式 shim,支持可选的 HTTPS 源站覆盖。 plugins.CapacitorPasskey.
  • autoShimWebAuthn(options?) 读取已解析的运行时配置文件
  • createCredential(options) 读取该配置文件并在应用程序引导期间在一步中安装 shim。 getCredential(options)
  • isSupported() 直接调用 WebAuthn JSON 安全负载的本机 passkey API。 getPluginVersion() 报告运行时可用性并