firebase
Simplifies Firebase integration for Flutter, including Auth, Firestore, and Analytics.
Install
mkdir -p .claude/skills/firebase-lapc506 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16898" && unzip -o skill.zip -d .claude/skills/firebase-lapc506 && rm skill.zipInstalls to .claude/skills/firebase-lapc506
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
| Atributo | Valor | |----------|-------| | **ID** | `flutter-firebase` | | **Nivel** | 🟡 Intermedio | | **Versión** | 2.0.0 | | **Keywords** | `firebase`, `firestore`, `auth`, `cloud-messaging`, `analytics`, `storage`, `remote-config`, `crashlytics`, `provider` | | **ReferenciaKey capabilities
- →Integrate Firebase Authentication into Flutter projects
- →Implement Firestore Database functionality in Flutter
- →Configure Firebase Cloud Storage for file management
- →Set up Firebase Cloud Messaging for push notifications
- →Integrate Firebase Analytics for tracking user behavior
How it works
This skill provides a complete guide for integrating various Firebase services into a Flutter project, including authentication, Firestore, Cloud Storage, Cloud Messaging, Analytics, Crashlytics, and Remote Config. It outlines project structure, required dependencies, and initial configuration steps for Android an
Inputs & outputs
When to use firebase
- →Setup Firebase for Flutter project
- →Implement Email/Password authentication
- →Integrate Cloud Messaging push notifications
- →Initialize Firebase Analytics
About this skill
🔥 Skill: Firebase Integration
📋 Metadata
| Atributo | Valor |
|---|---|
| ID | flutter-firebase |
| Nivel | 🟡 Intermedio |
| Versión | 2.0.0 |
| Keywords | firebase, firestore, auth, cloud-messaging, analytics, storage, remote-config, crashlytics, provider |
| Referencia | FlutterFire |
🔑 Keywords para Invocación
firebasefirestorefirebase-authcloud-messagingfirebase-analyticsfirebase-storagefirebase-remote-configfirebase-crashlyticsprovider@skill:firebase
Ejemplos de Prompts
Integra Firebase con auth y Firestore
Implementa Firebase Authentication y Cloud Messaging
@skill:firebase - Configura Firebase completo
📖 Descripción
Firebase Integration proporciona servicios backend completos: Authentication (Email/Password y Google Sign-In), Firestore Database, Cloud Storage, Push Notifications (FCM), Analytics (con tracking de screens, eventos personalizados, user ID y propiedades), Crashlytics y Remote Config. Incluye integración con Provider para state management y configuración multiplataforma con mejores prácticas.
⚠️ IMPORTANTE: Todos los comandos de este skill deben ejecutarse desde la raíz del proyecto (donde existe el directorio mobile/). El skill incluye verificaciones para asegurar que se está en el directorio correcto antes de ejecutar cualquier comando.
⚠️ IMPORTANTE: Todos los comandos de este skill deben ejecutarse desde la raíz del proyecto (donde existe el directorio mobile/). El skill incluye verificaciones para asegurar que se está en el directorio correcto antes de ejecutar cualquier comando.
✅ Cuándo Usar Este Skill
- Backend as a Service rápido
- Authentication con múltiples providers
- Base de datos en tiempo real
- Push notifications
- Analytics y Crashlytics
- Remote Config para A/B testing
- Rapid prototyping
❌ Cuándo NO Usar Este Skill
- Requieres control total del backend
- Costos de Firebase son prohibitivos
- Backend custom ya existe
🏗️ Estructura del Proyecto
lib/
├── core/
│ ├── firebase/
│ │ ├── firebase_options.dart (generado)
│ │ ├── firebase_config.dart
│ │ └── firebase_initialization.dart
│ └── services/
│ ├── analytics_service.dart
│ ├── crashlytics_service.dart
│ ├── remote_config_service.dart
│ └── storage_service.dart
│
├── features/
│ ├── authentication/
│ │ ├── data/
│ │ │ ├── datasources/
│ │ │ │ └── firebase_auth_datasource.dart
│ │ │ └── repositories/
│ │ │ └── auth_repository_impl.dart
│ │ ├── domain/
│ │ │ ├── entities/
│ │ │ │ └── user.dart
│ │ │ └── repositories/
│ │ │ └── auth_repository.dart
│ │ └── presentation/
│ │ ├── screens/
│ │ │ └── login_screen.dart
│ │ ├── providers/
│ │ │ └── auth_provider.dart
│ │ └── bloc/
│ │ └── auth_bloc.dart
│ │
│ ├── products/
│ │ ├── data/
│ │ │ ├── datasources/
│ │ │ │ └── firestore_products_datasource.dart
│ │ │ └── models/
│ │ │ └── product_model.dart
│ │ └── domain/
│ │ └── entities/
│ │ └── product.dart
│ │
│ └── notifications/
│ ├── data/
│ │ ├── datasources/
│ │ │ └── fcm_datasource.dart
│ │ └── services/
│ │ └── notification_service.dart
│ └── presentation/
│ └── screens/
│ └── notifications_screen.dart
│
└── main.dart
📦 Dependencias Requeridas
dependencies:
flutter:
sdk: flutter
# Firebase Core
firebase_core: ^2.24.2
# Firebase Authentication
firebase_auth: ^4.15.3
google_sign_in: ^6.2.1
# Cloud Firestore
cloud_firestore: ^4.13.6
# Cloud Storage
firebase_storage: ^11.5.6
# Cloud Messaging
firebase_messaging: ^14.7.9
flutter_local_notifications: ^16.3.0
# Firebase Analytics
firebase_analytics: ^10.7.4
# Crashlytics
firebase_crashlytics: ^3.4.8
# Remote Config
firebase_remote_config: ^4.3.8
# State Management
provider: ^6.1.1
# Image Picker (para Storage)
image_picker: ^1.0.7
# Utils
equatable: ^2.0.5
dartz: ^0.10.1
dev_dependencies:
flutter_test:
sdk: flutter
⚙️ Configuración Inicial
1. Firebase CLI Setup
# Instalar Firebase CLI
npm install -g firebase-tools
# Login a Firebase
firebase login
# Verificar que estamos en la raíz del proyecto
if [ ! -d "mobile" ]; then
echo "Error: Ejecuta este comando desde la raíz del proyecto"
exit 1
fi
# Instalar FlutterFire CLI
dart pub global activate flutterfire_cli
# Configurar Firebase para el proyecto
cd mobile
flutterfire configure
cd ..
flutterfire configure
2. Android Configuration
// android/build.gradle
buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
}
}
// android/app/build.gradle
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
defaultConfig {
minSdkVersion 21 // Firebase requires 21+
}
}
3. iOS Configuration
# ios/Podfile
platform :ios, '13.0' # Firebase requires 13.0+
# Después de flutter_install_all_ios_pods
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
💻 Implementación
1. Firebase Initialization
// lib/main.dart
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize Firebase
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
// Pass all uncaught errors to Crashlytics
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
runApp(const MyApp());
}
2. Firebase Authentication
// lib/features/authentication/data/datasources/firebase_auth_datasource.dart
import 'package:firebase_auth/firebase_auth.dart' as firebase_auth;
import 'package:google_sign_in/google_sign_in.dart';
import '../models/user_model.dart';
abstract class FirebaseAuthDataSource {
Stream<UserModel?> get authStateChanges;
Future<UserModel> signInWithEmailAndPassword(String email, String password);
Future<UserModel> signUpWithEmailAndPassword(String email, String password);
Future<UserModel> signInWithGoogle();
Future<void> signOut();
Future<void> sendPasswordResetEmail(String email);
UserModel? getCurrentUser();
}
class FirebaseAuthDataSourceImpl implements FirebaseAuthDataSource {
final firebase_auth.FirebaseAuth _firebaseAuth;
final GoogleSignIn _googleSignIn;
FirebaseAuthDataSourceImpl({
firebase_auth.FirebaseAuth? firebaseAuth,
GoogleSignIn? googleSignIn,
}) : _firebaseAuth = firebaseAuth ?? firebase_auth.FirebaseAuth.instance,
_googleSignIn = googleSignIn ?? GoogleSignIn();
@override
Stream<UserModel?> get authStateChanges {
return _firebaseAuth.authStateChanges().map((firebaseUser) {
return firebaseUser != null ? UserModel.fromFirebaseUser(firebaseUser) : null;
});
}
@override
Future<UserModel> signInWithEmailAndPassword(
String email,
String password,
) async {
try {
final credential = await _firebaseAuth.signInWithEmailAndPassword(
email: email,
password: password,
);
if (credential.user == null) {
throw Exception('Sign in failed');
}
return UserModel.fromFirebaseUser(credential.user!);
} on firebase_auth.FirebaseAuthException catch (e) {
throw _handleAuthException(e);
}
}
@override
Future<UserModel> signUpWithEmailAndPassword(
String email,
String password,
) async {
try {
final credential = await _firebaseAuth.createUserWithEmailAndPassword(
email: email,
password: password,
);
if (credential.user == null) {
throw Exception('Sign up failed');
}
return UserModel.fromFirebaseUser(credential.user!);
} on firebase_auth.FirebaseAuthException catch (e) {
throw _handleAuthException(e);
}
}
@override
Future<UserModel> signInWithGoogle() async {
try {
// Trigger the authentication flow
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
if (googleUser == null) {
throw Exception('Google sign in was cancelled');
}
// Obtain the auth details from the request
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
// Create a new credential
final credential = firebase_auth.GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
// Sign in to Firebase with the Google credential
final userCredential = await _firebaseAuth.signInWithCredential(credential);
if (userCredential.user == null) {
throw Exception('Google sign in failed');
}
return UserModel.fromFirebaseUser(userCredential.user!);
} on firebase_auth.FirebaseAuthException catch (e) {
throw _handleAuthException(e);
} catch (e) {
throw Exception('Google sign in failed: $e');
}
}
@override
Future<void> signOut() async {
await Future.wait([
_firebaseAuth.signOut(),
_googleSignIn.signOut(),
]);
}
@override
Future<void> sendPasswordResetEmail(String email) async {
try {
await _firebaseAuth.sendPasswordResetEmail(email: em
---
*Content truncated.*
When not to use it
- →When requiring total control over the backend infrastructure
- →When Firebase costs are prohibitive for the project budget
- →When a custom backend already exists and is in use
Limitations
- →Todos los comandos de este skill deben ejecutarse desde la **raíz del proyecto** (donde existe el directorio `mobile/`).
- →Firebase requires `minSdkVersion 21` for Android.
- →Firebase requires `platform :ios, '13.0'` for iOS.
How it compares
This skill offers a structured, best-practices approach to integrating a wide array of Firebase services into Flutter, including state management with Provider, rather than piecemeal integration.
Compared to similar skills
firebase side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| firebase (this skill) | 0 | 5mo | Review | Intermediate |
| supabase-developer | 95 | 7mo | Review | Intermediate |
| better-auth-best-practices | 18 | 6mo | No flags | Intermediate |
| webf-native-plugin-dev | 2 | 7mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
supabase-developer
daffy0208
Build full-stack applications with Supabase (PostgreSQL, Auth, Storage, Real-time, Edge Functions). Use when implementing authentication, database design with RLS, file storage, real-time features, or serverless functions.
better-auth-best-practices
novuhq
Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.
webf-native-plugin-dev
openwebf
Develop custom WebF native plugins based on Flutter packages. Create reusable plugins that wrap Flutter/platform capabilities as JavaScript APIs. Use when building plugins for native features like camera, payments, sensors, file access, or wrapping existing Flutter packages.
cloudbase-guidelines
TencentCloudBase
Essential CloudBase (TCB, Tencent CloudBase, 云开发, 微信云开发) development guidelines. MUST read when working with CloudBase projects, developing web apps, mini programs, or backend services using CloudBase platform.
firebase-vertex-ai
jeremylongshore
Execute firebase platform expert with Vertex AI Gemini integration for Authentication, Firestore, Storage, Functions, Hosting, and AI-powered features. Use when asked to "setup firebase", "deploy to firebase", or "integrate vertex ai with firebase". Trigger with relevant phrases based on skill purpose.
auth-nodejs-cloudbase
TencentCloudBase
Complete guide for CloudBase Auth using the CloudBase Node SDK – caller identity, user lookup, custom login tickets, and server-side best practices.