firebase-auth
FeaturedUse 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
Quality Score: 95/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
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
API & Backend Featured
firebase-analytics
Use when logging analytics events, setting user properties, configuring default event parameters, building funnels, or adding screen-view tracking.
619 Updated today
evanca API & Backend Featured
firebase-messaging
Use when setting up Firebase Cloud Messaging, managing permissions and tokens, handling background/foreground notification taps, or dispatching messages server-side (HTTP v1).
619 Updated today
evanca API & Backend Featured
firebase-database
Use when syncing real-time data, structuring JSON trees, reading/writing, creating listeners, enabling offline persistence, managing presence, sharding, or writing security rules.
619 Updated today
evanca