Firebase Kotlin SDK

A Kotlin Multiplatform SDK for Firebase, with a focus on Firebase AI (Generative AI) capabilities.
Modules
Supported Platforms
- Android
- iOS (arm64, simulatorArm64)
Installation
Version Catalog (Recommended)
Add to your gradle/libs.versions.toml:
[versions]
firebase-kotlin-sdk = "0.10.0"
[libraries]
firebase-app = { module = "dev.ynagai.firebase:firebase-app", version.ref = "firebase-kotlin-sdk" }
firebase-ai = { module = "dev.ynagai.firebase:firebase-ai", version.ref = "firebase-kotlin-sdk" }
firebase-auth = { module = "dev.ynagai.firebase:firebase-auth", version.ref = }
= { module = , version.ref = }
Dependencies
Add to your module's build.gradle.kts:
kotlin {
sourceSets {
commonMain.dependencies {
implementation(libs.firebase.app)
implementation(libs.firebase.ai)
implementation(libs.firebase.auth)
implementation(libs.firebase.firestore)
}
}
}
Usage
See each module's README for detailed usage and examples:
- Firebase AI — Generative AI with Gemini (text generation, streaming, chat, content DSL)
- Firebase Auth — Authentication (email/password, social providers, phone, MFA)
- Firebase Firestore — Cloud Firestore (CRUD, queries, real-time listeners, transactions)
Platform Setup
Android
Add your google-services.json to your app module and apply the Google Services plugin:
plugins {
id("com.google.gms.google-services") version "4.4.2" apply false
}
plugins {
id("com.google.gms.google-services")
}
iOS
Add your GoogleService-Info.plist to your Xcode project and initialize Firebase in your app delegate:
import FirebaseCore
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application( : ,
: [.: ]) -> {
.configure()
}
}
License
Copyright 2025 Yuki Nagai
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:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.