feat(mobile): add the Expo starter and the mobile template kind - #90
Merged
Conversation
This was referenced Sep 13, 2026
templates/mobile/expo is a complete Expo Router app on @seamless-auth/react-native: sign up and sign in with a one-time email code, a sign-in link by polling, or a passkey; passkey enrolment after sign up; route groups gated on the session; and a protected call to the companion API through useAuthorizedFetch. The session lives in the platform keystore between launches. tools/associations/generate.mjs writes the two association files native passkeys need from one set of inputs and prints the matching Android origin, so the hex fingerprint and its base64url form cannot drift apart. build is expo export for iOS and Android, which CI can run without a native toolchain. The validator accepts kind mobile, the registry lists the starter as expo (alias mobile, beta), and the manifest places it at mobile/. The Express and Fastify starters pass authServerUrl and audience into requireAuth so a scaffolded API accepts a native client's access token alongside cookies. Refs #36, #37, #38, #39.
Bccorb
force-pushed
the
feat/mobile-expo-template
branch
from
September 13, 2026 16:21
df84831 to
694d844
Compare
Bccorb
marked this pull request as ready for review
September 13, 2026 16:49
This was referenced Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #36, #37, #38, #39 (the template half of the epic #40). On the published
@seamless-auth/react-native0.1.0,@seamless-auth/express0.16.0 and@seamless-auth/fastify0.7.0; the three lockfiles carry them as of the last two commits.templates/mobile/expoA complete Expo 57 + Expo Router app on
@seamless-auth/react-native:app/_layout.tsx:AuthProviderover bearer transport with the native ports built once at module scope (src/auth/ports.ts:react-native-passkeys,expo-secure-store,expo-web-browser); a configuration screen whenEXPO_PUBLIC_API_URLis missing.(auth)group: sign-in (identifier →/login→ passkey attempt when the device has one → email code or magic link fallback), sign-up (register → code), verify-code (one screen for both flows; uppercases since the API's codes are six letters;textContentType="oneTimeCode"), magic-link-sent (polls/magic-link/checkevery 5s for 10 minutes; no deep link needed), register-passkey (enrol withdescribeDevice(Platform); skip only whenhasNonPasskeyLoginMethod).(app)group: the signed-in screen with a protected call to the companion API's/beta_usersthroughuseAuthorizedFetch().app/index.tsxwaits for the keystore restore so a signed-in user never sees sign-in flash.tools/associations/generate.mjs: writesapple-app-site-associationandassetlinks.jsonfrom team id, bundle id, package, and the certificate SHA-256, and prints theandroid:apk-key-hash:origin from the same bytes (the hand conversion is the common failure). README covers the prerequisites that cannot be removed and the traps from docs(mobile): association file tooling and per platform setup #39.buildisexpo export --platform ios --platform android, which the templates CI matrix runs without Xcode or the Android SDK. Vitest covers the pure modules; screens are exercised on a simulator.npx expo install, so they are the SDK 57 set.Repo
validate-templates.mjsacceptskind: "mobile";registry.jsonaddsexpo(aliasmobile, beta,templates/mobile/expo);template.jsonplaces it atmobile/withEXPO_PUBLIC_API_URLfrom{{apiUrl}},requires.cliMin: 0.16.0(the CLI PR that learns the kind follows).serveAdminConsoleanddatabaseUrlplaceholders the CLI already resolves), a "Mobile templates" note; AGENTS.md likewise;validate.ymlsays what the mobile build does and does not cover.authServerUrlandaudienceintorequireAuth, so a scaffolded API accepts the auth API's access token from a native client alongside browser cookies; bumped to@seamless-auth/express^0.16 /@seamless-auth/fastify^0.7.Not a
shared/react-appsync target: React Native cannot use the web kit.Verified locally
npm run validate(registry, manifests, shared sync);--matrixincludesexpotemplates/mobile/expo:npm run check(typecheck against the realreact-native-passkeystypes, lint, format, 4 tests) andnpm run build: Metro bundles for iOS (2.5MB) and Android (2.8MB) with the real SDK tarballs installedtools/associations/generate.mjsoutput checked against the spike's known fingerprint → origin pairnpm install+ lockfiles after the SDK releases