
Firebase SDK wrapper streamlining integration with a CLI setup wizard that automates Firebase config downloads, Gradle/SPM/CocoaPods setup, dependency installation, and generates init/sample code.
Firebase SDK for Kotlin Multiplatform
Get Started • Usage • Modules • Manual Installation
The fastest way to add Firebase to your KMP project.
Create a Firebase project at console.firebase.google.com (just the project — no need to add apps, the CLI does it automatically)
brew tap riadmahi/kfire
brew install kfirekfire initThe CLI automatically:
| Step | What it does |
|---|---|
| Firebase config | Downloads google-services.json and GoogleService-Info.plist
|
| Gradle dependencies | Adds Firebase modules to your build.gradle.kts
|
| Gradle plugins | Adds google-services + crashlytics plugin (if selected) |
| iOS dependencies | Configures SPM or CocoaPods (your choice) |
| Sample code | Generates FirebaseInit.kt with initialization code |
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!
// Initialize once at app startup
FirebaseApp.initialize()val auth = FirebaseAuth.getInstance()
// Sign in
auth.signInWithEmailAndPassword("user@example.com", "password")
// Create account
auth.createUserWithEmailAndPassword("user@example.com", "password")
// Current user
val user = auth.currentUserval db = FirebaseFirestore.getInstance()
// Add a city
val city = hashMapOf(
"name" to "Los Angeles",
"state" to "CA",
"country" to "USA",
"capital" to false,
"population" to 3900000
)
db.collection("cities").document("LA").set(city)
// Get a city
val document = db.collection("cities").document("LA").get()
// Query cities
val cities = db.collection("cities")
.whereEqualTo("country", "USA")
.whereGreaterThan("population", 1000000)
.get()val storage = FirebaseStorage.getInstance()
val ref = storage.reference.child("images/mountains.jpg")
// Upload
ref.putBytes(imageData)
// Download URL
val url = ref.downloadUrl| Module | Artifact | Description |
|---|---|---|
| Core | firebase-core |
Firebase initialization (required) |
| Auth | firebase-auth |
Authentication (Email, Google, Apple, Phone) |
| Firestore | firebase-firestore |
NoSQL cloud database |
| Storage | firebase-storage |
File storage and uploads |
| Messaging | firebase-messaging |
Push notifications (FCM/APNs) |
| Analytics | firebase-analytics |
Event tracking and user analytics |
| Remote Config | firebase-remoteconfig |
Feature flags and A/B testing |
| Crashlytics | firebase-crashlytics |
Crash reporting |
// build.gradle.kts (commonMain)
dependencies {
implementation("com.riadmahi.firebase:firebase-core:1.0.0")
implementation("com.riadmahi.firebase:firebase-auth:1.0.0")
implementation("com.riadmahi.firebase:firebase-firestore:1.0.0")
// ... add modules you need
}google-services.json → Place in your Android app moduleGoogleService-Info.plist → Add to Xcode project// Root build.gradle.kts
plugins {
id("com.google.gms.google-services") version "4.4.2" apply false
}
// App build.gradle.kts
plugins {
id("com.google.gms.google-services")
}Choose SPM or CocoaPods:
Swift Package Manager
https://github.com/firebase/firebase-ios-sdk.git
CocoaPods
# Podfile
platform :ios, '15.0'
use_frameworks!
target 'YourApp' do
pod 'FirebaseCore'
pod 'FirebaseAuth'
pod 'FirebaseFirestore'
endThen run pod install and open .xcworkspace.
| Platform | Minimum Version |
|---|---|
| Android | API 24 (Android 7.0) |
| iOS | 15.0 |
| Kotlin | 2.3.0 |
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://www.apache.org/licenses/LICENSE-2.0
Firebase SDK for Kotlin Multiplatform
Get Started • Usage • Modules • Manual Installation
The fastest way to add Firebase to your KMP project.
Create a Firebase project at console.firebase.google.com (just the project — no need to add apps, the CLI does it automatically)
brew tap riadmahi/kfire
brew install kfirekfire initThe CLI automatically:
| Step | What it does |
|---|---|
| Firebase config | Downloads google-services.json and GoogleService-Info.plist
|
| Gradle dependencies | Adds Firebase modules to your build.gradle.kts
|
| Gradle plugins | Adds google-services + crashlytics plugin (if selected) |
| iOS dependencies | Configures SPM or CocoaPods (your choice) |
| Sample code | Generates FirebaseInit.kt with initialization code |
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!
// Initialize once at app startup
FirebaseApp.initialize()val auth = FirebaseAuth.getInstance()
// Sign in
auth.signInWithEmailAndPassword("user@example.com", "password")
// Create account
auth.createUserWithEmailAndPassword("user@example.com", "password")
// Current user
val user = auth.currentUserval db = FirebaseFirestore.getInstance()
// Add a city
val city = hashMapOf(
"name" to "Los Angeles",
"state" to "CA",
"country" to "USA",
"capital" to false,
"population" to 3900000
)
db.collection("cities").document("LA").set(city)
// Get a city
val document = db.collection("cities").document("LA").get()
// Query cities
val cities = db.collection("cities")
.whereEqualTo("country", "USA")
.whereGreaterThan("population", 1000000)
.get()val storage = FirebaseStorage.getInstance()
val ref = storage.reference.child("images/mountains.jpg")
// Upload
ref.putBytes(imageData)
// Download URL
val url = ref.downloadUrl| Module | Artifact | Description |
|---|---|---|
| Core | firebase-core |
Firebase initialization (required) |
| Auth | firebase-auth |
Authentication (Email, Google, Apple, Phone) |
| Firestore | firebase-firestore |
NoSQL cloud database |
| Storage | firebase-storage |
File storage and uploads |
| Messaging | firebase-messaging |
Push notifications (FCM/APNs) |
| Analytics | firebase-analytics |
Event tracking and user analytics |
| Remote Config | firebase-remoteconfig |
Feature flags and A/B testing |
| Crashlytics | firebase-crashlytics |
Crash reporting |
// build.gradle.kts (commonMain)
dependencies {
implementation("com.riadmahi.firebase:firebase-core:1.0.0")
implementation("com.riadmahi.firebase:firebase-auth:1.0.0")
implementation("com.riadmahi.firebase:firebase-firestore:1.0.0")
// ... add modules you need
}google-services.json → Place in your Android app moduleGoogleService-Info.plist → Add to Xcode project// Root build.gradle.kts
plugins {
id("com.google.gms.google-services") version "4.4.2" apply false
}
// App build.gradle.kts
plugins {
id("com.google.gms.google-services")
}Choose SPM or CocoaPods:
Swift Package Manager
https://github.com/firebase/firebase-ios-sdk.git
CocoaPods
# Podfile
platform :ios, '15.0'
use_frameworks!
target 'YourApp' do
pod 'FirebaseCore'
pod 'FirebaseAuth'
pod 'FirebaseFirestore'
endThen run pod install and open .xcworkspace.
| Platform | Minimum Version |
|---|---|
| Android | API 24 (Android 7.0) |
| iOS | 15.0 |
| Kotlin | 2.3.0 |
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://www.apache.org/licenses/LICENSE-2.0