biometric_auth_sdk Pro
Biometric authentication (Face ID / Touch ID / fingerprint) feature SDK. Wraps
local_authand integrates as a passive unlock gate withauth_sdk.
Version: 1.0.0
Variables
This brick has no generation-time variables. All runtime configuration is done via the generated BiometricAuthSDK interface.
Usage
Interactive
archipelago generate biometric_auth_sdkNon-interactive (CI)
archipelago generate biometric_auth_sdk --config my_config.jsonGenerated Structure
features/
└── biometric_auth/
├── biometric_auth_api/
│ └── lib/src/
│ └── models/
└── biometric_auth_impl/
└── lib/src/
└── di/Platform Setup
iOS — Info.plist
Add the Face ID usage description to ios/Runner/Info.plist:
<key>NSFaceIDUsageDescription</key>
<string>We use Face ID to quickly verify your identity.</string>Without this key the app will crash at runtime when local_auth requests Face ID on iOS.
Android — Permission
local_auth uses BiometricPrompt which does not require explicit manifest permissions on API 28+. For API 23–27 (fingerprint only), add:
<uses-permission android:name="android.permission.USE_FINGERPRINT" />Unlock vs. Primary Credential
Biometric is an unlock gate, not a primary credential. After a successful BiometricAuthSDK.authenticate() call, the host app is responsible for calling authSDK.loginSuccess(userId: cachedUserId) to restore the session. The SDK intentionally does not do this automatically to keep session semantics under the caller's control.
Runtime API
final biometricSDK = getIt<BiometricAuthSDK>();
// Check device support:
final isSupported = await biometricSDK.isAvailable();
// Authenticate:
final result = await biometricSDK.authenticate(
reason: 'Verify your identity to continue',
);
if (result.isSuccess) {
// Restore session in auth_sdk
await getIt<AuthSDK>().loginSuccess(userId: cachedUserId);
}Known Limitations
- Does not store or manage session tokens — that responsibility remains with
auth_sdk. - On Android emulators without enrolled biometrics,
isAvailable()returnsfalse.