Download client/firebase/firebaseConfig.js from marvin-cusm-chatbot/champ-chatbot: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/spaces/marvin-cusm-chatbot/champ-chatbot/resolve/main/client/firebase/firebaseConfig.js
- Command line
-
hf download hf://spaces/marvin-cusm-chatbot/champ-chatbot/client/firebase/firebaseConfig.js
-
curl -L -o firebaseConfig.js https://huggingface.co/spaces/marvin-cusm-chatbot/champ-chatbot/resolve/main/client/firebase/firebaseConfig.js
1.92 kB
| // Import the functions you need from the SDKs you need | |
| import { initializeApp, getApps, getApp } from "firebase/app"; | |
| //import { getAnalytics } from "firebase/analytics"; | |
| import { getAuth } from "firebase/auth"; | |
| import { getFirestore } from "firebase/firestore"; | |
| // TODO: Add SDKs for Firebase products that you want to use | |
| // https://firebase.google.com/docs/web/setup#available-libraries | |
| // Expo only inlines process.env.EXPO_PUBLIC_* written out in full, so each variable is named here. | |
| const env = { | |
| EXPO_PUBLIC_FIREBASE_API_KEY: process.env.EXPO_PUBLIC_FIREBASE_API_KEY, | |
| EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN: process.env.EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN, | |
| EXPO_PUBLIC_FIREBASE_PROJECT_ID: process.env.EXPO_PUBLIC_FIREBASE_PROJECT_ID, | |
| EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET: process.env.EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET, | |
| EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: process.env.EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID, | |
| EXPO_PUBLIC_FIREBASE_APP_ID: process.env.EXPO_PUBLIC_FIREBASE_APP_ID, | |
| }; | |
| const missing = Object.keys(env).filter((name) => !env[name]); | |
| if (missing.length > 0) { | |
| throw new Error( | |
| `Missing Firebase config: ${missing.join(", ")}. Set them in client/.env (see client/.env.dist).` | |
| ); | |
| } | |
| const firebaseConfig = { | |
| apiKey: env.EXPO_PUBLIC_FIREBASE_API_KEY, | |
| authDomain: env.EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN, | |
| projectId: env.EXPO_PUBLIC_FIREBASE_PROJECT_ID, | |
| storageBucket: env.EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET, | |
| messagingSenderId: env.EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID, | |
| appId: env.EXPO_PUBLIC_FIREBASE_APP_ID, | |
| }; | |
| // Initialize Firebase | |
| //const app = initializeApp(firebaseConfig); | |
| //const analytics = getAnalytics(app); | |
| const app = | |
| getApps().length === 0 | |
| ? initializeApp(firebaseConfig) | |
| : getApp(); | |
| // Initialize Firebase Authentication and get a reference to the service | |
| export const auth = getAuth(app); | |
| export const db = getFirestore(app); | |