Kumaran Masilamani
04/15/2025, 9:29 AMFilip Wiesner
04/15/2025, 10:12 AMKumaran Masilamani
04/15/2025, 10:18 AMkotlin
implementation(npm("firebase", "11.6.0"))
inside the
jsMain
block of site/build.gradle.kts
.
But even after that, I’m still unable to access Firebase classes from my Kotlin code.
Any example repo on how this is typically set up would be helpful? (Me being a back-end developer)Filip Wiesner
04/15/2025, 10:26 AMFilip Wiesner
04/15/2025, 10:32 AMMy main question is about how to organize Firebase-related code in a fullstack Kobweb projectPersonally, I don't really want to give advice on architecture of your app. I don't have that figured out myself. I just have some sort of
FirebaseSource
implementation on all platforms and I call that pretty much directly from presentation layer (with one "use-case layer" between).Ahmed Riyadh
04/15/2025, 11:10 AM[versions]
# For latest version: <https://mvnrepository.com/artifact/com.google.api-client/google-api-client>
google-api-client = "2.7.2"
[libraries]
# <https://developers.google.com/api-client-library/java/google-api-java-client/setup#google-api-client>
google-api-client = { module = "com.google.api-client:google-api-client", version.ref = "google-api-client" }
Refer to the official example.
Here is an example usage:
private val googleIdTokenVerifier =
GoogleIdTokenVerifier.Builder(NetHttpTransport(), GsonFactory())
.setAudience(
listOf(
// For multiple apps googleAndroidClientId, googleIosClientId
)
)
.build()
// Null if the id token is invalid
val idToken: GoogleIdToken? = googleIdTokenVerifier.verify(googleIdToken)
Filip Wiesner
04/15/2025, 11:12 AMKumaran Masilamani
04/15/2025, 11:55 AMDavid Herman
04/15/2025, 5:34 PM