Example app
example/ is a NitroUI app that shows every status value and opens prompts. It depends on the package through the workspace (nitro-local-auth: workspace:*) and on NitroUI 0.3.0.
What it shows
| Row | Source |
|---|---|
| Has hardware | hasHardware() |
| Enrolled | isEnrolled() |
| Supported types | getSupportedAuthenticationTypes() |
| Enrolled level | getEnrolledLevel() |
| Locked out | isLockedOut() |
| Last result | The latest authenticate result and warning |
| Button | Options |
|---|---|
| Authenticate | promptMessage, promptSubtitle; device fallback on |
| Authenticate with biometrics only | cancelLabel: 'Not now', disableDeviceFallback: true, biometricsSecurityLevel: 'strong' |
| Refresh | Reads the status values again |
Run it
From the repository root:
bun install # links the workspace and prepares the example
bun run example ios # or android
Native tests
The example also hosts nitro-ui-harness tests in example/__tests__, which run inside the app on a simulator, emulator or device:
bun run test:ios --device "<simulator name or UDID>"
bun run test:android --device <adb-serial>
Tests that apply to one platform are named *.ios.harness.ts or *.android.harness.ts. CI runs them on an iOS simulator and an Android emulator, which have no enrolled biometrics and no passcode, so they cover the status APIs and failure paths. Check a successful prompt by hand on a device, or on a simulator with Features > Face ID > Enrolled.