adding firebase stuff
This commit is contained in:
28
src/lib/Firebase/config.js
Normal file
28
src/lib/Firebase/config.js
Normal file
@@ -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);
|
||||
Reference in New Issue
Block a user