メインコンテンツにジャンプ
Back to plugins
@capgo/capacitor-native-biometric
チュートリアル
@capgo/capacitor-native-biometric

Native Biometric

Face ID、Touch ID、Android バイオメトリック API を使用したセキュアな認証

ガイド

Native Biometricのチュートリアル

デバイスでテスト

Download the Capgo app, then scan the QR code.

ネイティブバイオメトリックプラグインプレビューQRcode

Using @capgo/capacitor-native-biometric

このプラグインは、AndroidおよびiOSのネイティブバイオメトリックAPIにアクセスすることができます。

インストール

bun add @capgo/capacitor-native-biometric
bunx cap sync

このプラグインが公開するもの

  • isAvailable - バイオメトリック認証ハードウェアが利用可能かどうかを確認します。
  • verifyIdentity - ユーザーにバイオメトリック認証を求めます。
  • getCredentials - 指定されたサーバーに対して保存されたクレデンシャルを取得します。
  • setCredentials - 指定されたサーバーに対してクレデンシャルを保存します。

使用例

isAvailable

バイオメトリック認証ハードウェアが利用可能かどうかを確認します。

import { NativeBiometric } from '@capgo/capacitor-native-biometric';

await NativeBiometric.isAvailable();

verifyIdentity

指紋認証を使用してユーザーを認証するように促します。

import { NativeBiometric } from '@capgo/capacitor-native-biometric';

await NativeBiometric.verifyIdentity();

getCredentials

指定されたサーバーに対して保存されたクレデンシャルを取得します。

import { NativeBiometric } from '@capgo/capacitor-native-biometric';

await NativeBiometric.getCredentials({} as GetCredentialOptions);

setCredentials

指定されたサーバーに対してクレデンシャルを保存します。

import { NativeBiometric } from '@capgo/capacitor-native-biometric';

await NativeBiometric.setCredentials({} as SetCredentialOptions);

フル リファレンス

Using @capgo/capacitor-native-biometric

指紋認証を使用してユーザーを認証するように促します。 Using @capgo/capacitor-native-biometric 認証とアカウントフローの計画に使用している場合、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-native-biometricを接続してください。 Using @capgo/capacitor-native-biometric for the implementation detail in @capgo/capacitor-native-biometric, Getting Started for the implementation detail in Getting Started, @capgo/capacitor-social-login for the implementation detail in @capgo/capacitor-social-login, @capgo/capacitor-passkey for the implementation detail in @capgo/capacitor-passkey, and Two-factor authentication for the implementation detail in Two-factor authentication.