-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfirebaseconfig.js
29 lines (26 loc) · 1.14 KB
/
firebaseconfig.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
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";
import { initializeAuth, getReactNativePersistence } from "firebase/auth";
import ReactNativeAsyncStorage from "@react-native-async-storage/async-storage";
import {
DEV_FIREBASE_API_KEY,
DEV_FIREBASE_AUTH_DOMAIN,
DEV_FIREBASE_PROJECT_ID,
DEV_FIREBASE_STORAGE_BUCKET,
DEV_FIREBASE_MESSAGING_SENDER_ID,
DEV_FIREBASE_APP_ID,
} from "@env";
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: process.env.FIREBASE_API_KEY || DEV_FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN || DEV_FIREBASE_AUTH_DOMAIN,
projectId: process.env.FIREBASE_PROJECT_ID || DEV_FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET || DEV_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID || DEV_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID || DEV_FIREBASE_APP_ID,
};
const app = initializeApp(firebaseConfig);
export const db = getFirestore(app);
export const auth = initializeAuth(app, {
persistence: getReactNativePersistence(ReactNativeAsyncStorage),
});