firebase_core_web
4.2.0, released 4 days ago by firebase.google.com
Web implementation of firebase_core for Flutter apps.
What it does
Provides the platform-specific code to initialize and use Firebase on Flutter web. It registers the web implementation of the core Firebase plugin and keeps the Firebase JS SDK up‑to‑date.
AI-written summary of version 4.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building a Flutter app that runs on the web and needs Firebase initialization
- You want the official Firebase support for web without writing platform code
Skip it when
- Targeting only mobile or desktop platforms
- You need Firebase services beyond core (e.g., Auth, Firestore) without adding their web plugins
Strengths
- Official FlutterFire plugin with timely updates
- Handles web‑specific setup like script loading and dart2wasm flags
- Simple drop‑in for web projects
Weaknesses
- Only works on web; no effect on other platforms
- Requires firebase_core as a companion package
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add firebase_core and firebase_core_web to pubspec, run flutter pub get, and configure Firebase via the web config snippet in index.html as described in the FlutterFire docs.
import 'package:firebase_core/firebase_core.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}Alternatives
Packages that do the same job and could replace firebase_core_web.
- cloud_firestore
Flutter plugin for Cloud Firestore noSQL database with live synchronization.
98Compare - cloud_functions
Flutter plugin for using the Cloud Functions for Firebase API.
96Compare - flutterfire_cli
CLI to configure Firebase services in Flutter projects
84Compare - relic_core
Core framework for Relic web server
82Compare
Works with
Packages commonly used together with firebase_core_web: ones it builds on, ones built on it, and its own family.
- webfirebase_core_web depends on itLightweight bindings for browser APIs via JS interop
- firebase_messagingSame familyFlutter plugin for Firebase Cloud Messaging to deliver messages on Android, iOS, web, and macOS.
- firebase_analyticsSame familyFlutter plugin for Google Analytics for Firebase.
- firebase_crashlyticsSame familyFlutter plugin that sends uncaught errors and crash reports to Firebase Crashlytics.
- firebase_authSame familyFlutter plugin for Firebase Authentication enabling passwords, phone numbers, and identity providers.
- firebase_remote_configSame familyFlutter plugin for Firebase Remote Config API
- firebase_storageSame familyFlutter plugin to read and write files in Firebase Cloud Storage.
- firebase_app_checkSame familyProtect your Firebase backend resources from abuse and fraud.