How to secure DB secrets in T3 stack (Next.js)
I am getting up and running with the T3 stack and I am wondering where I can keep my database secrets so they aren't bundled into the client. For instance, I want to use firebase-admin on my server which requires me to have a firebase config file. How can I tell NextJS "please keep these secrets only on the server side"?
5 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
so would i move all of the stuff out of the json file?
json file?
you put env variables in an .env file
the ones you prefix with
NEXT_PUBLIC_
are going to be exposed to the client
the other ones are gonna stay in the serveri mean the json config file i get from firebase
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View