The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. Its API is similar to the Firebase Android SDK Kotlin Extensions but also supports multiplatform projects, enabling you to use Firebase directly from your common source targeting iOS, Android, Desktop, or Web, enabling the use of Firebase as a backend for Compose Multiplatform, for example. Unlike the Kotlin Extensions for the Firebase Android SDK this project does not extend a Java-based SDK so we get the full power of Kotlin including coroutines and serialization. Asynchronous operations that return a single or no value are represented by suspending functions in the SDK instead of callbacks, listeners or OS specific types such as Task.
Features
- Asynchronous streams of values are represented by Flows in the SDK instead of repeatedly invoked callbacks or listeners
- The official Firebase SDKs use different platform-specific ways to support writing data with and without custom classes in Cloud Firestore, Realtime Database and Functions
- The encodeDefaults parameter is optional and defaults to true
- Polymorphic serialization (sealed classes)
- Operator overloading
- The Firebase Kotlin SDK provides a common API to access Firebase for projects