Skip to content

Commit ba56ef8

Browse files
committed
Made the firebase safer and wrote more documentation in the README.
1 parent 2801fef commit ba56ef8

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ cp .env.example .env.local
5757
2. Get the Firebase configuration values from your team lead or the Firebase Console
5858
3. Update `.env.local` with your Firebase configuration:
5959
```bash
60-
REACT_APP_FIREBASE_API_KEY=your_api_key_here
61-
REACT_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
62-
REACT_APP_FIREBASE_DATABASE_URL=https://your_project.firebasedatabase.app
63-
REACT_APP_FIREBASE_PROJECT_ID=your_project_id
64-
REACT_APP_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
65-
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
66-
REACT_APP_FIREBASE_APP_ID=your_app_id
60+
VITE_FIREBASE_API_KEY=your_api_key_here
61+
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
62+
VITE_FIREBASE_DATABASE_URL=https://your_project.firebasedatabase.app
63+
VITE_FIREBASE_PROJECT_ID=your_project_id
64+
VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
65+
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
66+
VITE_FIREBASE_APP_ID=your_app_id
6767
```
6868

6969
### Database Population

my-app/firebase.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { reaction, toJS } from "mobx";
66

77
// Your web app's Firebase configuration
88
const firebaseConfig = {
9-
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
10-
authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
11-
databaseURL: process.env.REACT_APP_FIREBASE_DATABASE_URL,
12-
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
13-
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
14-
messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
15-
appId: process.env.REACT_APP_FIREBASE_APP_ID,
9+
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
10+
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
11+
databaseURL: import.meta.env.VITE_FIREBASE_DATABASE_URL,
12+
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
13+
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
14+
messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
15+
appId: import.meta.env.VITE_FIREBASE_APP_ID,
1616
};
1717

1818
// Initialize Firebase

0 commit comments

Comments
 (0)