-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebase.ts
27 lines (22 loc) · 823 Bytes
/
firebase.ts
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
26
27
import { getApp, getApps, initializeApp } from "firebase/app"
import { getAuth } from "firebase/auth"
import { getFirestore } from "firebase/firestore"
import { getFunctions } from "firebase/functions"
const firebaseConfig = {
apiKey: "AIzaSyCBD1aL8GqAY_CWBm5Slrq9NVyt6iodZi0",
authDomain: "saas-translation-app-c1ced.firebaseapp.com",
projectId: "saas-translation-app-c1ced",
storageBucket: "saas-translation-app-c1ced.appspot.com",
messagingSenderId: "831128739261",
appId: "1:831128739261:web:047a9153f01e92e08ec6d4"
};
//checking length will prevent from duplicating the instances
const app = getApps().length ? getApp() : initializeApp(firebaseConfig);
const auth = getAuth(app);
const db = getFirestore(app);
const functions = getFunctions(app);
export {
db,
auth,
functions
}