Firebase KMP
Firebase SDK for Kotlin Multiplatform
Get Started •
Usage •
Modules •
Manual Installation
Get Started
The fastest way to add Firebase to your KMP project.
Prerequisites
Create a Firebase project at console.firebase.google.com (just the project — no need to add apps, the CLI does it automatically)
1. Install the CLI
brew tap riadmahi/kfire
brew install kfire
2. Run the setup wizard
kfire init
3. That's it!
The CLI automatically:
kfire init
✓ firebase-tools installed
✓ Authenticated with Firebase
✓ Project scanned
Select your Firebase project
● my-app (my-app-12345)
Which Firebase services do you need?
✓ Authentication
✓ Firestore
○ Storage
○ Messaging
✓ Analytics
○ Remote Config
✓ Crashlytics
How do you want to manage iOS dependencies?
● Swift Package Manager (SPM) — Recommended
○ CocoaPods
✓ Android configured → google-services.json
✓ iOS configured → GoogleService-Info.plist
✓ SPM configured → Firebase packages added to Xcode
✓ Gradle updated → firebase-core, firebase-auth, firebase-firestore, firebase-analytics, firebase-crashlytics
Setup Complete!
Usage
FirebaseApp.initialize()
Authentication
val auth = FirebaseAuth.getInstance()
auth.signInWithEmailAndPassword("user@example.com", "password")
auth.createUserWithEmailAndPassword("user@example.com", "password")
val user = auth.currentUser
Firestore
Storage
val storage = FirebaseStorage.getInstance()
val ref = storage.reference.child("images/mountains.jpg")
ref.putBytes(imageData)
val url = ref.downloadUrl
Modules
Manual Installation
Requirements
| Platform | Minimum Version |
|---|
| Android | API 24 (Android 7.0) |
| iOS | 15.0 |
| Kotlin | 2.3.0 |
License
Copyright 2025 Riad Mahi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:
GitHub •
Firebase Docs •
Kotlin Multiplatform