-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize firebase and added firebase.js config file #10
Conversation
This is my first ever PR so lemme know if I'm dumb or did something wrong. |
Nice Looks Good to me |
@toreylittlefield please review this |
@MacAndersonUche / @ranegray you want to fix this up so we can merge it? |
@toreylittlefield do i just delete the conflict markers using the web editor? |
@ranegray first switch to main. Then pull down the changes Then switch back to your branch here. Then merge main onto your branch You'll have the chance to solve the merge conflicts. I recommend just solving the conflicts in the package.json. Looks like new files have been installed. Don't worry about the package-lock it'll be too big a pain in the ass. once you resolve the merge conflicts in package.json. Just delete package-lock and then run |
firebaseConfig.js
Outdated
const firebaseConfig = { | ||
apiKey: process.env.apiKey, | ||
authDomain: process.env.authDomain, | ||
projectId: process.env.projectId, | ||
storageBucket: process.env.storageBucket, | ||
messagingSenderId: process.env.messagingSenderId, | ||
appId: process.env.appId, | ||
measurementId: process.env.measurementId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these keys need to be prefix with NEXT_PUBLIC
to work clientside. I don't know enough about firebase yet but are these configuration values supposed to be exposed client side or server side only?
I think only firebase admin keys should be private and secured server side?
Also nextjs will work out of the box with a .local.env file or whatever but not .env see the docs.
Can you also just confirm somehow that the configuration is working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the docs (https://firebase.google.com/docs/projects/api-keys):
Unlike how API keys are typically used, API keys for Firebase services are not used to control access to backend resources; that can only be done with Firebase Security Rules (to control which users can access resources) and App Check (to control which apps can access resources).
Usually, you need to fastidiously guard API keys (for example, by using a vault service or setting the keys as environment variables); however, API keys for Firebase services are ok to include in code or checked-in config files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranegray you're right but maybe safer for now to use the .env.local
because we haven't set the Firebase Security Rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a .env.local
i created it. do you want me to put that file somewhere. obviously its not going to push to GitHub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranegray yep you're right no need to share it 😄 Just please update the variable name for those secrets to use the NEXT_PUBLIC syntax thank you!
@ranegray nice work and thanks! I got it working on my end using my own firebase credentials 💯 . I'll merge for now but my suggestion is to move out this file into the Another thing is the
Last thing I'll create a separate ticket for these issues here #20. Again great job and congrats! |
This should be everything we need to start coding. Everything else can be handled in the firebase console which I will add people too.