firebase-auth
Skill0 starsChanged 5 months agoMITView on GitHub
Sets up Firebase Authentication with email/password, Google Sign-In, and Apple Sign-In. Use this skill whenever the user needs sign-in, sign-up, user sessions, password reset, OAuth providers, or auth-gated routes in a web, React Native, or Expo app.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- evanca/flutter-ai-rulestheir own version, first seen Aug 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- evanca/flutter-ai-rules★ 669same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- firebase-ai-logicSkill
- firebase-analyticsSkill
- firebase-app-checkSkill
- firebase-architectureSkill
- firebase-cloud-functionsSkill
- firebase-cost-optimizationSkill
- firebase-crashlyticsSkill
- firebase-emulatorsSkill
- firebase-expoSkill
- firebase-firestoreSkill
- firebase-hostingSkill
- firebase-messagingSkill
- firebase-realtime-databaseSkill
- firebase-remote-configSkill
- firebase-storageSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
If none exists, create one:
- Distinctive: line 38
Make sure the local working directory is initialized:
- Distinctive: line 83
If the user wants the canonical Expo sign-in screen with email + Google, invoke the scaffold instead of typing it out:
- Very specific: line 107
When this skill is used together with firebase-firestore or firebase-cloud-functions, the canonical pattern is:
- Very specific: line 130
If the user asks about any of these, point them at the appropriate reference file or expand with details from the official docs at …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Firebase Authentication
Minimum viable example
import auth from "@react-native-firebase/auth";
await auth().signInWithEmailAndPassword(email, password);
auth().onAuthStateChanged((user) => setUser(user)); // sole source of truthThat's the whole loop. Everything else — Google, Apple, password reset, custom claims — is a variation on this pattern.
1. Prerequisites
A Firebase project must exist before running anything in this skill. Verify with:
npx -y firebase-tools@latest projects:listIf none exists, create one:
npx -y firebase-tools@latest projects:createMake sure the local working directory is initialized:
npx -y firebase-tools@latest init2. Provisioning providers
Configure providers in firebase.json. Only anonymous, emailPassword, and googleSignIn can be enabled fully via CLI. Apple Sign-In requires manual steps in the Firebase Console.
{
"auth": {
"providers": {
"anonymous": true,
"emailPassword": true,
"googleSignIn": {
"oAuthBrandDisplayName": "My App",
"supportEmail": "support@example.com",
"authorizedRedirectUris": ["https://myapp.example.com"]
}
}
}
}CRITICAL: deploy the config so the backend provisions OAuth clients:
npx -y firebase-tools@latest deploy --only authApple Sign-In
Apple cannot be enabled by CLI. Walk the user through:
- Open
https://console.firebase.google.com/project/_/authentication/providers - Enable Apple provider
- For iOS: enable the Sign in with Apple capability in Xcode; no Service ID needed
- For Android/Web: create a Service ID in the Apple Developer portal, set the redirect URL Firebase shows, paste the Service ID and key into the Firebase console
For full Apple setup steps see references/apple-signin.md.
Scaffold a sign-in screen
If the user wants the canonical Expo sign-in screen with email + Google, invoke the scaffold instead of typing it out:
node node_modules/firebase-agent-skills/scripts/scaffold/auth-screen.mjs \
--out 'app/(auth)/sign-in.tsx'Then replace YOUR_WEB_CLIENT_ID with the value from Google Cloud Console. The scaffold mirrors section 3's recommended pattern exactly.
3. Client SDK usage
The right module depends on the target platform:
- Web / Next.js / Vite →
firebasenpm package (see references/web-sdk.md) - Expo / React Native →
@react-native-firebase/authconfig plugin (see thefirebase-exposkill, then references/react-native.md)
Universal patterns to follow
- Never store the user object in your own state — subscribe to
onAuthStateChangedand derive state from it. This avoids stale UI after token refresh, sign-out, or account deletion. - Always await
auth.authStateReady()(web) or useonAuthStateChanged(RN) before deciding whether to redirect to a sign-in screen. Otherwise the user briefly sees the sign-in screen on every reload. - Never send the ID token to your own backend without verifying it server-side with the Firebase Admin SDK. The client can forge anything else.
4. Securing data with auth
When this skill is used together with firebase-firestore or firebase-cloud-functions, the canonical pattern is:
- Firestore rules:
allow read, write: if request.auth != null && request.auth.uid == resource.data.ownerId; - Callable Cloud Functions: read
request.auth.uid— ifundefined, throwHttpsError("unauthenticated", ...)
Defer to those skills for the full details.
5. Common mistakes
- Storing the user object in your own state instead of subscribing to
onAuthStateChanged. Leads to stale UI after token refresh, sign-out, or account deletion. Always derive from the auth listener. - Deciding redirects before
authStateReady()resolves. Causes a flash of the sign-in screen on every reload. Wait for the SDK to rehydrate before routing. - Sending the ID token to your backend without verifying it server-side. The client can forge any header except the ID token's signature. Verify with the Admin SDK on every request.
- Mixing the web SDK and
@react-native-firebase/authin one app. Two SDK init paths, two auth states, subtle desyncs. Pick one per app. - Forgetting to deploy auth config after editing
firebase.json. Provider changes don't apply untilnpx -y firebase-tools@latest deploy --only authruns. - Using the iOS OAuth client ID as Google
webClientIdon RN. Wrong — use the Web client ID auto-generated by the deploy step. Found in Google Cloud Console → Credentials.
6. Common follow-ups
- Password reset →
sendPasswordResetEmail(auth, email)(web) orauth().sendPasswordResetEmail(email)(RN) - Email verification →
sendEmailVerification(user)immediately after sign-up - Account linking (anonymous → permanent) →
linkWithCredential(user, credential) - Custom claims (roles, tiers) → set from the Admin SDK / a Cloud Function, then
await user.getIdToken(true)on the client to refresh
If the user asks about any of these, point them at the appropriate reference file or expand with details from the official docs at https://firebase.google.com/docs/auth.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

