Add official React Native / Expo SDK with Clerk-like DX: protected routes, RBAC components, and declarative auth UI
The Firebase Auth SDK for React Native requires significant boilerplate
to implement properly — auth state listeners, Firestore role fetching,
route protection, and error handling all have to be wired up manually
in every project.
The developer experience gap compared to alternatives like Clerk is
significant. Clerk provides:
• <SignedIn> / <SignedOut> declarative components
• <Protect role="admin"> role-based rendering
• Automatic route guards for Expo Router
• Pre-built auth screens
I built an open-source package called react-native-fireguard that fills
this gap for Firebase developers:
npm install react-native-fireguard
It wraps Firebase Auth with:
• <FirebaseAuthProvider> — single setup, handles everything
• <RouteGuard> — automatic redirect for unauthenticated users
• <SignedIn>, <SignedOut>, <Protect> — declarative components
• Role-based access control via Firestore
• Security fixes: onIdTokenChanged instead of onAuthStateChanged
(catches server-side revocations), raw User never in React state,
email enumeration prevention
364 downloads in the first 4 days suggests strong developer demand.
npm: https://www.npmjs.com/package/react-native-fireguard
GitHub: https://github.com/Inspire00/react-native-fireguard
My suggestion to Firebase: consider building this officially into the
Firebase JS SDK or partnering with the community. React Native developers
need a first-class auth DX story, not 300 lines of boilerplate in every
project.