All jobs

Add Biometric Login to an Expo App from a Linear Issue

Yes. An agent reads the labelled Linear issue, adds a biometric lock to your Expo app's auth flow with a toggle, tests and a config plugin, and opens a PR.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent starts from the auth the app already has. In an app generated from infinitered/ignite, app/context/AuthContext.tsx keeps authToken and authEmail in MMKV through useMMKVString under the keys AuthProvider.authToken and AuthProvider.authEmail, derives isAuthenticated from the token, and exposes logout. app/navigators/AppNavigator.tsx reads isAuthenticated and picks Welcome or Login as initialRouteName, rendering the Welcome and Demo screens on one side of a conditional and Login on the other. app/screens/LoginScreen.tsx pre-fills a demo email and password and stores String(Date.now()) as the token, and app/screens/DemoDebugScreen.tsx is a list of ListItem rows with a log out button at the bottom, the natural home for a settings toggle.

Then it reads how the app is configured, tested and translated. package.json pins expo 55.0.5, react-native 0.83.2 and react 19.2.0, with scripts compile for tsc --noEmit, lint:check, test for Jest on the jest-expo preset, and test:maestro for the flows under .maestro/flows. app.json lists the config plugins expo-localization, expo-font, expo-splash-screen, react-native-edge-to-edge and expo-build-properties, with userInterfaceStyle automatic and newArchEnabled true. Every user-facing string lives in app/i18n/en.ts with sibling files for ar, es, fr, hi, ja and ko, and test/i18n.test.ts greps the codebase for every tx key, so a key used in one locale and missing in another fails the suite. test/setup.ts already mocks react-native, i18next and expo-localization.

The agent installs expo-local-authentication with npx expo install so its version matches SDK 55 and adds it to plugins in app.json with a faceIDPermission string, which is what puts NSFaceIDUsageDescription into the iOS build. It writes app/utils/biometrics.ts with three functions: whether the device has enrolled biometrics, from hasHardwareAsync and isEnrolledAsync; a prompt that calls authenticateAsync with a translated reason and disableDeviceFallback false, so a passcode still works; and a label for the toggle from supportedAuthenticationTypesAsync. In AuthContext it adds isBiometricLockEnabled stored with useMMKVBoolean under AuthProvider.biometricLock, an isUnlocked state that starts false when the lock is on, and an AppState listener that sets it back to false when the app returns from the background. AppNavigator gains a Lock screen shown while authenticated and not unlocked, and DemoDebugScreen gains a ListItem with a Switch that enables the lock only after one successful prompt, so nobody is locked out of a device with no enrolled biometrics.

Strings go into en.ts and each of the six other locale files, because i18n.test.ts would otherwise fail. test/setup.ts gets a mock of expo-local-authentication, and new tests under app/utils/biometrics.test.ts cover the enrolled, not enrolled and cancelled cases. Before pushing, the agent runs yarn compile, yarn lint:check and yarn test in its sandbox, and npx expo config --type prebuild to show the plugin resolves and the permission string lands in the generated config. It does not run an EAS build or a Maestro flow, because both need a device or the project's Expo account, and it says so in the pull request, which links back to the Linear issue.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "A Linear issue labelled agent says: \"Add a biometric lock to the app. After signing in, people who turn it on in settings must pass Face ID, Touch ID or the Android fingerprint prompt every time the app comes back from the background. Fall back to the device passcode. Never lock someone out on a device with no enrolled biometrics.\" Do the work in this Expo app. Read package.json, app.json, app.config.ts, app/app.tsx, app/context/AuthContext.tsx, app/navigators/AppNavigator.tsx, app/screens/LoginScreen.tsx, app/screens/DemoDebugScreen.tsx, app/utils/storage/index.ts, app/i18n/en.ts and the other locale files, test/setup.ts, test/i18n.test.ts and jest.config.js first. Install expo-local-authentication with npx expo install and add its config plugin to app.json with a Face ID permission string. Put the availability check, prompt and label in app/utils/biometrics.ts, keep the enabled flag in MMKV beside the auth token, add a lock screen to the navigator, re-lock on return from background, and add the toggle to the debug screen so it turns on only after one successful prompt. Add every new string to every locale file, mock the module in test/setup.ts, write tests for the helper, and run compile, lint:check, test and npx expo config --type prebuild before you push. Do not run an EAS build. Open a pull request that links the issue.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

What comes back is a pull request on its own branch that changes package.json and the lockfile to add expo-local-authentication, app.json to add its plugin and permission string, app/context/AuthContext.tsx for the flag, the unlocked state and the AppState listener, app/navigators/AppNavigator.tsx for the Lock route, app/screens/DemoDebugScreen.tsx for the toggle, test/setup.ts for the mock, and all seven files under app/i18n/ for the new keys, plus new app/screens/LockScreen.tsx, app/utils/biometrics.ts and app/utils/biometrics.test.ts. The description quotes the issue, explains the enrol-before-enable rule, and names the one manual step left: a development build, since Expo Go cannot show the Face ID prompt for a custom permission string.

The proof is the output the agent ran in its sandbox and kept in the run's record: tsc --noEmit, eslint, the Jest suite including i18n.test.ts passing against the new keys, and expo config --type prebuild showing NSFaceIDUsageDescription and the Android USE_BIOMETRIC permission in the generated config. Any workflow the repository runs on pull requests runs here as well. No device test is claimed.

Before merging, a reviewer checks that the lock screen cannot be dismissed by navigating back, that a cancelled prompt leaves the app locked rather than signed out, that the AppState listener does not fire the prompt twice on iOS when the app becomes active, and that the permission string reads well in the App Store review. Then they build the development profile from eas.json, enrol a face or fingerprint on a device and try the toggle.

Run it on every Linear issue labelled auth

Sign in to Linear once with POST /me/connections {"type": "app", "name": "linear"} and finish the authorize URL in the console. Then add an automation to the Project with this prompt and a linear trigger on linear.issue.labeled, naming the label in its labels setting. The trigger places the issue after the prompt and fills in no placeholder, so the agent reads the lock rule, the fallback and the settings location from the issue text, and the pull request links back to the issue. The automation's max_runs_per_hour, between 1 and 30, caps how many labelled issues it takes on in an hour, each in its own sandbox with its own pull request.

Without an automation, a handler on your server that receives Linear's webhook can send this same request with the issue text copied into input and the issue URL in resources beside the repository, with a request_id that is a UUID v5 of the issue id so a redelivered webhook returns the run already started.

The use case this job follows, with its automation and trigger: Turn a Linear label into a PR.

Why run it on Rush?

A biometric lock touches the native config, the auth context, the navigator, the settings screen and seven translation files, and the Ignite i18n test fails the moment one locale misses a key. On Rush the agent makes all of those edits in its own sandbox, runs the type check, lint and the full Jest suite before its first push, and runs expo config --type prebuild to show the plugin and permission resolve, so the first review is of a branch that already passes. Your laptop installs nothing.

The result is a pull request with its evidence attached: every command and its output in the run's record, a diff a reviewer can read file by file, and a link to the issue that asked for it. Several labelled issues start several runs at once, each on its own branch, so an auth change does not wait behind whatever else the team is doing.

Frequently asked questions

Does it test the Face ID prompt itself?

No. The prompt needs a device or simulator with enrolled biometrics, which the sandbox does not have. The agent mocks expo-local-authentication in test/setup.ts, tests the helper's enrolled, not enrolled and cancelled paths with Jest, and shows through expo config --type prebuild that the permission string and plugin resolve. The device test is the reviewer's first step after a development build.

Why is the lock off by default?

Because the issue asks for people to turn it on, and because enabling it blindly would lock out anyone on a device with no enrolled biometrics. The toggle on the debug screen only flips to on after one successful authenticateAsync call, and the flag lives in MMKV beside the auth token so a log out clears both.

Does this work in Expo Go?

The module itself does, but a custom faceIDPermission string needs a development build, because Expo Go ships its own Info.plist. The pull request says so and names the development profile in eas.json as the first thing to build.

Will the i18n test fail on the new strings?

It would if a key were missing from any locale, so the agent adds every new key to en.ts and the ar, es, fr, hi, ja and ko files. Translations other than English are marked for a translator in the pull request, and yarn test runs i18n.test.ts in the sandbox before the push.

More Expo jobs

The same job on other stacks

More jobs like this: Turn a Linear label into a PR

Keep reading