put firebase api in .env (old values are outdated)

This commit is contained in:
Janis Meister
2023-05-23 10:33:36 +02:00
parent 4c1022d1f8
commit 219b1705c1
3 changed files with 29 additions and 7 deletions

2
.gitignore vendored
View File

@@ -19,6 +19,7 @@
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
@@ -27,6 +28,7 @@ yarn-error.log*
# local env files
.env*.local
.env
# vercel
.vercel

View File

@@ -6,3 +6,13 @@ This app functions as a flyer for the apartment in Altenau. It has no booking fu
We use Firebase for the backend. The app is configured to use the Firebase project `altenau-apartment`.
Texts based on languages are stored in the `localeTexts` collection. Since NextJS caches the HTML file its not bad to always fetch the texts from the database.
## .env file
FIREBASE_API_KEY=""
FIREBASE_AUTH_DOMAIN=""
FIREBASE_PROJECT_ID=""
FIREBASE_STORAGE_BUCKET=""
FIREBASE_MESSAGING_SENDER_ID=""
FIREBASE_APP_ID=""
FIREBASE_MEASUREMENT_ID=""

View File

@@ -2,15 +2,25 @@ import { getFirestore } from "@firebase/firestore";
import { initializeApp } from "firebase/app";
const firebaseConfig = {
apiKey: "AIzaSyBpj2FZEONb_Qpca4-brCzB0OVJPf3l8hk",
authDomain: "apartment-f960a.firebaseapp.com",
projectId: "apartment-f960a",
storageBucket: "apartment-f960a.appspot.com",
messagingSenderId: "1007134515151",
appId: "1:1007134515151:web:9ff0216c618b55a571bcba",
measurementId: "G-RMSZVM1BCG",
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
projectId: process.env.FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
measurementId: process.env.FIREBASE_MEASUREMENT_ID,
};
console.log({
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
projectId: process.env.FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
measurementId: process.env.FIREBASE_MEASUREMENT_ID,
});
const app = initializeApp(firebaseConfig);
export const db = getFirestore();