-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.js
More file actions
31 lines (27 loc) · 1.26 KB
/
Copy pathconfig.js
File metadata and controls
31 lines (27 loc) · 1.26 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
31
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import { getAuth } from "firebase/auth";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: import.meta.env.VITE_FIREBASE_API_KEY || '',
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN || '',
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID || '',
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET || '',
messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID || '',
appId: import.meta.env.VITE_FIREBASE_APP_ID || '',
measurementId: import.meta.env.VITE_FIREBASE_MEASUREMENT_ID || '',
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
export const auth = getAuth(app);
// Backend API URL - reads from VITE_API_URL env variable
// Set in .env (local dev) and .env.production (production build)
const config = {
apiUrl: (import.meta.env.VITE_API_URL || '/api').replace(/\/api\/?$/, '')
};
export default config;