From 18a403ad8fef216df1cee9e0493f9dd668006cb8 Mon Sep 17 00:00:00 2001 From: Samantha Date: Mon, 1 Jun 2026 13:12:15 +0900 Subject: [PATCH] adding firebase stuff --- src/lib/Firebase/config.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/lib/Firebase/config.js diff --git a/src/lib/Firebase/config.js b/src/lib/Firebase/config.js new file mode 100644 index 0000000..02b2c04 --- /dev/null +++ b/src/lib/Firebase/config.js @@ -0,0 +1,28 @@ + +// we get all our firebase config from the .env file, not included in the repo, so we don't share our API keys. +// then we initialize the app and export the database and storage so we can use them in other files + +import { initializeApp } from 'firebase/app'; +import { getFirestore } from 'firebase/firestore'; +import { getStorage } from 'firebase/storage'; +import { + PUBLIC_FIREBASE_API_KEY, + PUBLIC_FIREBASE_AUTH_DOMAIN, + PUBLIC_FIREBASE_PROJECT_ID, + PUBLIC_FIREBASE_STORAGE_BUCKET, + PUBLIC_FIREBASE_MESSAGING_SENDER_ID, + PUBLIC_FIREBASE_APP_ID +} from '$env/static/public'; + +const firebaseConfig = { + apiKey: PUBLIC_FIREBASE_API_KEY, + authDomain: PUBLIC_FIREBASE_AUTH_DOMAIN, + projectId: PUBLIC_FIREBASE_PROJECT_ID, + storageBucket: PUBLIC_FIREBASE_STORAGE_BUCKET, + messagingSenderId: PUBLIC_FIREBASE_MESSAGING_SENDER_ID, + appId: PUBLIC_FIREBASE_APP_ID +}; + +const app = initializeApp(firebaseConfig); +export const db = getFirestore(app); +export const storage = getStorage(app); \ No newline at end of file