-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfirebaseConfig.ts
More file actions
30 lines (27 loc) · 1.03 KB
/
firebaseConfig.ts
File metadata and controls
30 lines (27 loc) · 1.03 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
26
27
28
29
30
import AsyncStorage from '@react-native-async-storage/async-storage';
import Constants from 'expo-constants';
import { initializeApp } from "firebase/app";
import { getReactNativePersistence, initializeAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
const extra = Constants.expoConfig?.extra as {
firebaseApiKey: string;
firebaseAuthDomain: string;
firebaseProjectId: string;
firebaseStorageBucket: string;
firebaseMessagingSenderId: string;
firebaseAppId: string;
};
const firebaseConfig = {
apiKey: extra.firebaseApiKey,
authDomain: extra.firebaseAuthDomain,
projectId: extra.firebaseProjectId,
storageBucket: extra.firebaseStorageBucket,
messagingSenderId: extra.firebaseMessagingSenderId,
appId: extra.firebaseAppId,
};
// Initialize Firebase
export const FIREBASE_APP = initializeApp(firebaseConfig);
export const FIREBASE_AUTH = initializeAuth(FIREBASE_APP, {
persistence: getReactNativePersistence(AsyncStorage),
});
export const FIREBASE_DB = getFirestore();