-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebaseConfig.ts
39 lines (35 loc) · 1.13 KB
/
firebaseConfig.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
28
29
30
31
32
33
34
35
36
37
38
39
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
import {
getReactNativePersistence,
getAuth,
initializeAuth,
inMemoryPersistence,
Auth,
} from 'firebase/auth';
import { getStorage } from 'firebase/storage';
import { getDatabase } from 'firebase/database';
import { Platform } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
export const firebaseConfig = {
apiKey: 'AIzaSyAql__a3U-pgQ21bTofEN_otegnM0N11lM',
authDomain: 'cheer-app-prototype.firebaseapp.com',
projectId: 'cheer-app-prototype',
storageBucket: 'cheer-app-prototype.appspot.com',
messagingSenderId: '949576645162',
appId: '1:949576645162:web:5ebaa19d4c8b88dcff6153',
};
export const app = initializeApp(firebaseConfig);
let auth: Auth;
if (Platform.OS === 'web') {
auth = getAuth(app);
auth.setPersistence(inMemoryPersistence);
} else {
auth = initializeAuth(app, {
persistence: getReactNativePersistence(AsyncStorage),
});
}
export { auth };
export const db = getFirestore(app);
export const storage = getStorage(app);
export const realtime = getDatabase(app);