-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfirebase.js
40 lines (34 loc) · 1.18 KB
/
firebase.js
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
28
29
30
31
32
33
34
35
36
37
38
39
40
import { fbConfig } from "./env";
import { initializeApp } from 'firebase/app';
import { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword } from "firebase/auth";
import { getStorage, ref as storageRef, uploadBytesResumable, getDownloadURL } from "firebase/storage";
import { getDatabase, ref as databaseRef, set as databaseSet, onValue as databaseOnValue, get as databaseGet, child as databaseChild, off as databaseOff } from "firebase/database";
// TODO: Replace the following with your app's Firebase project configuration
const firebaseConfig = {
apiKey: `${fbConfig.apiKey}`,
authDomain: `${fbConfig.authDomain}`,
projectId: `${fbConfig.projectId}`,
storageBucket: `${fbConfig.storageBucket}`,
messagingSenderId: `${fbConfig.messagingSenderId}`,
appId: `${fbConfig.appId}`,
};
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
const storage = getStorage(app);
const database = getDatabase(app);
export {
storage,
storageRef,
uploadBytesResumable,
getDownloadURL,
auth,
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
database,
databaseRef,
databaseSet,
databaseOnValue,
databaseGet,
databaseChild,
databaseOff
};