dentvega/firebase-agent-skills/firebase-auth

Claude Code and agent skill by dentvega/firebase-agent-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

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.

Install

npx vskill@latest install dentvega/firebase-agent-skills/firebase-auth

SKILL.md

The same SKILL.md was published earlier as dentvega/firebase-agent-skills/firebase-auth.

Firebase Authentication

Minimum viable example

ts // @verify
import auth from "@react-native-firebase/auth";
await auth().signInWithEmailAndPassword(email, password);
auth().onAuthStateChanged((user) => setUser(user)); // sole source of truth

That'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:

bash
npx -y firebase-tools@latest projects:list

If none exists, create one:

bash
npx -y firebase-tools@latest projects:create

Make sure the local working directory is initialized:

bash
npx -y firebase-tools@latest init

2. 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.

json
{
"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:

bash
npx -y firebase-tools@latest deploy --only auth
Apple Sign-In

Apple cannot be enabled by CLI. Walk the user through:

  1. Open https://console.firebase.google.com/project/_/authentication/providers
  2. Enable Apple provider
  3. For iOS: enable the Sign in with Apple capability in Xcode; no Service ID needed
  4. 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:

bash
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:

Universal patterns to follow
  • Never store the user object in your own state — subscribe to onAuthStateChanged and derive state from it. This avoids stale UI after token refresh, sign-out, or account deletion.
  • Always await auth.authStateReady() (web) or use onAuthStateChanged (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 — if undefined, throw HttpsError("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/auth` in 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 until npx -y firebase-tools@latest deploy --only auth runs.
  • Using the iOS OAuth client ID as Google `webClientId` on 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) or auth().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.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dentvega/firebase-agent-skills/firebase-auth/badge)](https://verified-skill.com/skills/dentvega/firebase-agent-skills/firebase-auth)

Something wrong with this skill or its page? Tell us.