Is there a way to use Firebase (Authentication) with Kotlin Multiplatform?

I gave a talk on libraries for KMP and specifically built a wrapper around Firestore to go along with it.

https://github.com/touchlab/FirestoreKMP

https://vimeo.com/371460823

In that library I create extension functions to implement features. Your question is kind of broad, but I'd probably start with:

//common
expect fun FirebaseAuth.signIn(email:String, password:String):Task<AuthDataResult>

//ios main
actual fun FirebaseAuth.signIn(email:String, password:String):Task<AuthDataResult> = signInWithEmail(email, password) //Figure out async return value

The async return stuff can be a little tricky, but the firestore code will have examples. One here:

https://github.com/touchlab/FirestoreKMP/blob/master/firestore/src/commonMain/kotlin/co/touchlab/firebase/firestore/Query.kt#L17


From now on there is a new official library about Kotlin Multiplatform firebase products. Supported platforms are Android, iOS and JavaScript.

https://firebaseopensource.com/projects/gitliveapp/firebase-kotlin-sdk/


I am building and publishing Firebase Wrappers for Kotlin Multiplatform!

Keep in mind that only common API between JS, JVM and iOS are available.

Here it is: https://github.com/lamba92/firebase-multiplatform