About ionic-biometric-auth
ionic-biometric-auth is a skill for integrating device biometrics into Ionic apps using `@aparajita/capacitor-biometric-auth`. It covers setup and safe usage, emphasizing that biometrics confirm local presence rather than authenticate a user to a backend.
Key features
- 01Setup guidance for the biometric authentication plugin
- 02Uses device Face ID, Touch ID, or fingerprint sensors
- 03Fallback guidance for passcode or password
- 04Guidance on app-lock routing and preferences
- 05Distinguishes local presence from backend sessions
Use cases
- 01Gate sensitive app features with a biometric prompt
- 02Lock app routes until local authentication succeeds
- 03Require renewed local proof after a session timeout
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ erkamyaman/ ionic-capacitor-skills --skill ionic-biometric-authAfter installing, type/ionic-biometric-authin Claude Code to confirm it loaded.
Bundled filesreferences/setup-and-usage.md
Details
From the project READMEBiometric Authentication
Use the device's biometric sensor (Face ID, Touch ID, fingerprint) to authenticate the user — for app lock, sensitive feature gating, or as a step-up after a session timeout.
When to consult
- Setup + permissions + usage: setup-and-usage.md
Hard rules
- ✅ Biometrics authenticate the user to the device, not to your backend. Don't treat a successful biometric prompt as a backend session — it's a local proof of presence. Pair with a server-issued token / session.
- ✅ For "app lock", store a flag in
@capacitor/preferencesand gate route navigation on it. - ✅ Provide a fallback to passcode / password when biometrics fail or are unavailable.
- ❌ Don't use biometrics to "decrypt" stored secrets directly in this plugin — for true secure-enclave-backed key storage, use a secure-storage plugin backed by the iOS Keychain / Android Keystore (e.g.
capacitor-secure-storage-plugin, or whichever community package is currently maintained — verify on npm before adopting). - ❌ Don't prompt for biometrics on every API call — that's both annoying and not what biometrics are for. Gate at app launch / on resume after a configurable timeout.
Library
npm install @aparajita/capacitor-biometric-auth
npx cap sync
Alternative plugins: @capgo/capacitor-native-biometric is also widely used. Pick one and stay consistent — they have similar APIs but different defaults.
Comments
Markdown supported