firebase-auth

Featured

Use when setting up auth, managing auth state, implementing email/password or social sign-in, handling auth errors, or managing users.

API & Backend 619 stars 60 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
93
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Firebase Authentication Skill This skill defines how to correctly use Firebase Authentication in Flutter applications. ## When to Use Use this skill when: * Setting up Firebase Authentication in a Flutter project. * Listening to authentication state changes. * Implementing email/password, phone number, or social sign-in. * Managing user profiles, account linking, or MFA. * Handling authentication errors (including iOS `recaptcha-sdk-not-linked` for phone auth). * Applying security best practices for auth flows. --- ## 1. Setup and Configuration ``` flutter pub add firebase_auth ``` ```dart import 'package:firebase_auth/firebase_auth.dart'; ``` - Enable desired authentication providers in the **Firebase console** before using them. - Initialize Firebase before using any Firebase Authentication features. **Local emulator for testing:** ```dart Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); await FirebaseAuth.instance.useAuthEmulator('localhost', 9099); // ... } ``` --- ## 2. Authentication State Management Use the appropriate stream based on what you need to observe: | Stream | Fires when | |---|---| | `authStateChanges()` | User signs in or out | | `idTokenChanges()` | ID token changes (including custom claims) | | `userChanges()` | User data changes (e.g., profile updates) | ```dart FirebaseAuth.instance .authStateChanges() .listen((User? user) { if (user == null) { print('User is ...

Details

Author
evanca
Repository
evanca/flutter-ai-rules
Created
1 years ago
Last Updated
today
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category