Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
My previous answer is using the Kotlin Firebase SDK to initialize Firebase. But I ran into problems and resolved to using JS in the jsMain to initialize Firebase. Here (js implementation)build.gradle jsMain
In a separate file
Then call init and try to create a user in auth to see if it works
It worked, but the code and API key were visible in dev tools sources tab. I realised I could use the Java server initialization to do it in jvmMain since Kotlin and Java are cool with each other.For the Kotlin + Java (for Firebase Server initialization) -> Get Java dependency declared in jvmMain dependencies
Then
then call To test if it was initialized, try connecting to Auth:
This, of course, works. |
Beta Was this translation helpful? Give feedback.
-
I'm programming a Kotlin JS website. How can I initialize my firebase app like the following js code?
const firebaseConfig = {
apiKey: "apiKey",
authDomain: "authDomain",
projectId: "projectId",
storageBucket: "storageBucket",
messagingSenderId: "messagingSenderId",
appId: "appId",
measurementId: "measurementId"
};
const app = initializeApp(firebaseConfig);
Beta Was this translation helpful? Give feedback.
All reactions