KFirebaseDatabase 2.0.0 indexed Streamlines Firebase integration in mobile apps for swift initialization on Android and iOS, enhancing development efficiency. Offers real-time data operations like write, read, update, and delete.
Bring this to kpkg
This library is indexed from the KMP ecosystem and already resolves through kpkg.dev's Maven Central proxy. Maintainers can verify the namespace and publish future versions to kpkg for free hosting, real download stats, and signed-provenance pages.
Publishing coming soonMetadata
Owner the-best-is-best
Stars 0
Used by —
Health —
License —
Latest 2.0.0
Repository github.com/the-best-is-best/KFirebaseDatabase
Updated 2025-09-03 Readme Changelog KFirebaseDatabase
KFirebaseDatabase is a Kotlin Multiplatform library designed to streamline the integration of Firebase services in your mobile applications. With this library, developers can effortlessly initialize Firebase for both Android and iOS, enabling a unified and efficient development experience
KFirebaseDatabase is available on mavenCentral().
Installation
implementation("io.github.the-best-is-best:kfirebase-database:2.0.0" )
iOS (Using Swift Package Manager - SPM)
Make sure to add Firebase as a dependency using Swift Package Manager (SPM).
Open your Xcode project.
Navigate to File > Add Packages....
Enter Firebase repository URL: https://github.com/firebase/firebase-ios-sdk
Choose FirebaseRemoteConfig and add it to your project.
iosApp
import Firebase
FirebaseApp .configure()
Usage
API
@OptIn(ExperimentalTime::class)
@Composable
@Preview
fun App () {
MaterialTheme {
val firebaseDatabase = KFirebaseDatabase()
var readValue by remember { mutableStateOf<String?>(null ) }
var listenValue by remember { mutableStateOf<String?>(null ) }
val scope = rememberCoroutineScope()
LaunchedEffect(Unit ) {
firebaseDatabase.addObserveValueListener("message" ).collect {
val result = it.getOrNull()
listenValue = result?.toString()
}
}
Scaffold {
Column(
modifier = Modifier
.fillMaxSize()
.safeContentPadding()
.background(MaterialTheme.colorScheme.background)
.padding(16. dp),
verticalArrangement = Arrangement.spacedBy(10. dp)
) {
ElevatedButton(
onClick = {
val newValue =
"Hello, KFirebase! ${Clock.System.now().toEpochMilliseconds()} "
scope.launch {
firebaseDatabase.write("message" , mapOf("text" to newValue))
}
},
modifier = Modifier
.fillMaxWidth()
) {
Text("Write to Database" )
}
ElevatedButton(
onClick = {
scope.launch {
val value = firebaseDatabase.read("message" )
value.onSuccess {
readValue = it?.toString()
}.onFailure {
readValue = "Error: ${it.message} "
}
}
},
modifier = Modifier
.fillMaxWidth()
) {
Text("read to Database" )
}
Text("Read Value: ${readValue ?: "No data" } " , modifier = Modifier.fillMaxWidth())
Text(
"Listen Value: ${listenValue ?: "No data" } " ,
modifier = Modifier.fillMaxWidth()
)
}
}
}
}
expect class KFirebaseDatabase () {
suspend fun write (path: String , data : Map <String , Any>) : Result<Boolean ?>
suspend fun read (path: String ) : Result<Any?>
suspend fun writeList (path: String , dataList: List <Map <String , Any>>) : Result<Boolean >
suspend fun readList (path: String ) : Result<List<Any?>>
suspend fun delete (path: String ) : Result<Boolean ?>
suspend fun update (path: String , data : Map <String , Any>) : Result<Boolean ?>
fun addObserveValueListener (path: String ) : Flow<Result<Any?>>
}
Related libraries Surfaced from shared tags and platforms — no rankings paid for.
basic-ads ★ 104
LexiLabs-App Enables rapid integration of Google AdMob on mobile platforms, displaying ads as Composables with customizable ad experiences through lambdas for flexible user interactions. Shared: service-sdk, sdk, client dd-sdk-kotlin-multiplatform ★ 25
DataDog Enables interaction with Datadog for log collection and real user monitoring, supporting integrations like Ktor. Facilitates log and RUM event exploration through Datadog's console. Shared: service-sdk, sdk, client appwrite-kmp ★ 19
JamshedAlamQaderi Enables seamless integration with Appwrite's backend services, offering consistent API, full cross-platform support, and functionality mirroring the Appwrite Android SDK for ease of use. Shared: service-sdk, sdk, client ozone ★ 123
christiandeange Compiles AT Protocol schemas into usable classes, provides APIs for the AT Protocol spec usable with services like Bluesky Social, and includes example client apps demonstrating API usage. Shared: swift, service-sdk, client kgoogle-map ★ 22
the-best-is-best Enables seamless integration of Google Maps functionalities in applications with a unified API, reducing platform-specific code. Offers map rendering, marker management, camera control, and Google Places suggestions. Shared: sdk, client, apple KmpEssentials ★ 359
Ares-Defence-Labs Lightweight library simplifies development with APIs for battery management, file system operations, and package information retrieval, supporting integration with multiple platforms and providing Swift package availability. Shared: swift, sdk, apple