<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm" -->

---
title: Kotlin / Wasm — Auth part 1: Google Sign in | daily.dev
description: A hands-on guide walks through implementing Google Sign-In with Firebase Authentication in Kotlin/Wasm, since the Firebase-Kotlin-SDK doesn&#x27;t support the Wasm...
canonical: https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Kotlin / Wasm — Auth part 1: Google Sign in | daily.dev
og:description: A hands-on guide walks through implementing Google Sign-In with Firebase Authentication in Kotlin/Wasm, since the Firebase-Kotlin-SDK doesn&#x27;t support the Wasm...
og:url: https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm
og:image: https://api.daily.dev/og/posts/DP1B4K1ZM.png
og:image:alt: Kotlin / Wasm — Auth part 1: Google Sign in
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Kotlin / Wasm — Auth part 1: Google Sign in

**[ProAndroidDev](https://daily.dev/sources/pand)** · 4 min read · 0 upvotes · 0 comments

## Summary

A hands-on guide walks through implementing Google Sign-In with Firebase Authentication in Kotlin/Wasm, since the Firebase-Kotlin-SDK doesn't support the Wasm target. Instead of using a wrapper library, the guide shows how to interop directly with the Firebase JS SDK via Kotlin/Wasm's external declarations, JsModule annotations, and js() helper functions. It covers Gradle setup with the npm firebase dependency, writing external interfaces for FirebaseApp and Auth, building JS objects without dynamic (unavailable in Wasm), and handling Wasm-specific quirks like Promise callbacks needing JsAny? returns and errors arriving as JsAny instead of Throwable. It also notes Safari's popup-blocking issues with Firebase auth flows.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://proandroiddev.com/kotlin-wasm-auth-part-1-google-sign-in-8287d61e82c9>

## Questions this post answers

### How do I add Google Sign-In with Firebase to a Kotlin/Wasm project?

Since the Firebase-Kotlin-SDK does not support the Wasm target, you call the Firebase JS SDK directly using Kotlin/Wasm external declarations. Add the npm firebase dependency (version 12.18.0) to wasmJsMain, write external interfaces annotated with @file:JsModule for firebase/app and firebase/auth, then call initializeApp, getAuth, and signInWithPopup with a GoogleAuthProvider, using js() to build plain JS option objects.

_daily.dev surfaces practical interop guides like this for teams shipping Kotlin Multiplatform to the web._

### Why can't I use dynamic or json() to build objects in Kotlin/Wasm like I did in Kotlin/JS?

Kotlin/Wasm has neither dynamic nor a json() helper, so plain JavaScript objects must be created with a js() function containing an object literal string, for example js("({ apiKey: apiKey, authDomain: authDomain })"). This differs from Kotlin/JS, where dynamic typing made ad hoc object construction straightforward.

_developers migrating Kotlin/JS code to Wasm can track these interop gotchas on daily.dev._

### Why do my Promise.then and .catch callbacks in Kotlin/Wasm need to return null?

Promise callbacks in Kotlin/Wasm must return a JsAny?, and Unit does not satisfy that type, so lambdas passed to then and catch need an explicit null at the end. Additionally, errors caught in a Promise's catch block arrive as JsAny rather than Throwable, requiring a small js() helper to extract the error message.

_daily.dev helps developers debugging Kotlin/Wasm JS interop quirks like this one stay unstuck._

## Similar posts on daily.dev

- [Kotlin / Wasm — Auth part 2: Apple sign in](https://daily.dev/posts/kotlin-wasm-auth-part-2-apple-sign-in-zl0teqgtf) · ProAndroidDev · 0 upvotes · 0 comments

---

Tags: [#authentication](https://daily.dev/tags/authentication), [#kotlin](https://daily.dev/tags/kotlin), [#webassembly](https://daily.dev/tags/webassembly), [#firebase](https://daily.dev/tags/firebase)

[View this post on daily.dev](https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Kotlin / Wasm — Auth part 1: Google Sign in","url":"https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm"},"datePublished":"2026-08-30T17:04:04.655Z","dateModified":"2026-08-30T17:04:33.597Z","description":"A hands-on guide walks through implementing Google Sign-In with Firebase Authentication in Kotlin/Wasm, since the Firebase-Kotlin-SDK doesn't support the Wasm...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6e84ee68bd524b0bb371cbfc0f3a838b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6e84ee68bd524b0bb371cbfc0f3a838b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ProAndroidDev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ProAndroidDev","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/656c1eb1f1ef4f91936e86fc16545114","url":"https://daily.dev/sources/pand"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"authentication,kotlin,webassembly,firebase","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ProAndroidDev","item":"https://daily.dev/sources/pand"},{"@type":"ListItem","position":3,"name":"Kotlin / Wasm — Auth part 1: Google Sign in"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/kotlin-wasm-auth-part-1-google-sign-in-dp1b4k1zm#faq","mainEntity":[{"@type":"Question","name":"How do I add Google Sign-In with Firebase to a Kotlin/Wasm project?","acceptedAnswer":{"@type":"Answer","text":"Since the Firebase-Kotlin-SDK does not support the Wasm target, you call the Firebase JS SDK directly using Kotlin/Wasm external declarations. Add the npm firebase dependency (version 12.18.0) to wasmJsMain, write external interfaces annotated with @file:JsModule for firebase/app and firebase/auth, then call initializeApp, getAuth, and signInWithPopup with a GoogleAuthProvider, using js() to build plain JS option objects. daily.dev surfaces practical interop guides like this for teams shipping Kotlin Multiplatform to the web."}},{"@type":"Question","name":"Why can't I use dynamic or json() to build objects in Kotlin/Wasm like I did in Kotlin/JS?","acceptedAnswer":{"@type":"Answer","text":"Kotlin/Wasm has neither dynamic nor a json() helper, so plain JavaScript objects must be created with a js() function containing an object literal string, for example js(\"({ apiKey: apiKey, authDomain: authDomain })\"). This differs from Kotlin/JS, where dynamic typing made ad hoc object construction straightforward. developers migrating Kotlin/JS code to Wasm can track these interop gotchas on daily.dev."}},{"@type":"Question","name":"Why do my Promise.then and .catch callbacks in Kotlin/Wasm need to return null?","acceptedAnswer":{"@type":"Answer","text":"Promise callbacks in Kotlin/Wasm must return a JsAny?, and Unit does not satisfy that type, so lambdas passed to then and catch need an explicit null at the end. Additionally, errors caught in a Promise's catch block arrive as JsAny rather than Throwable, requiring a small js() helper to extract the error message. daily.dev helps developers debugging Kotlin/Wasm JS interop quirks like this one stay unstuck."}}]}
```

