Im trying to use Firebase but it seems I'm missing up with configuration,
so Basically my firebaseinit.js file should contain my firebase config
import { initializeApp } from 'firebase/app';
import { getDatabase } from "firebase/database";
import { getAuth } from 'firebase/auth'
const firebaseConfig = {
//my configs
};
//initialize the firebase app
let app = initializeApp(firebaseConfig)
//initialize firebase auth
const auth = getAuth(app)
// Get a reference to the database service
const database = getDatabase(app);
//export the auth and db object
export { auth , database }
and in my register.vue view , I've imported
import {auth,db } from "../firebase/firebaseinit.js";
and in register function
const createUser = await auth.createUserWithEmailAndPassword(this.email, this.password);
const result = await createUser;
const dataBase = db.collection("users").doc(result.user.uid);
await dataBase.set({
name : this.name,
username: this.username,
email: this.email,
});
but it says that createUserWithEmailAndPassword is not defined