-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebaseAuth.js
More file actions
25 lines (22 loc) · 1.36 KB
/
firebaseAuth.js
File metadata and controls
25 lines (22 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Import the functions you need from the SDKs you need
import { initializeApp, getApps, getApp } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-app.js";
import { getAuth, signInWithEmailAndPassword, createUserWithEmailAndPassword, signOut, GoogleAuthProvider, signInWithPopup } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-auth.js";
import { getFirestore, collection, addDoc, getDocs, deleteDoc, doc } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-firestore.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyBLdmkBJCVxy9quJCIon1uE2wfCf59zTGo",
authDomain: "todoapp-da79d.firebaseapp.com",
databaseURL: "https://todoapp-da79d-default-rtdb.asia-southeast1.firebasedatabase.app",
projectId: "todoapp-da79d",
storageBucket: "todoapp-da79d.firebasestorage.app",
messagingSenderId: "586995521004",
appId: "1:586995521004:web:d56760d60e03b7714edcc9"
};
// Initialize Firebase
const app = !getApps().length ? initializeApp(firebaseConfig) : getApp();
const auth = getAuth(app);
const db = getFirestore(app);
const googleProvider = new GoogleAuthProvider();
export { auth, db, signInWithEmailAndPassword, createUserWithEmailAndPassword, signOut, googleProvider, signInWithPopup, app };