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
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Tom
TomOP3y ago
so would i move all of the stuff out of the json file?
nexxel
nexxel3y ago
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 server
Tom
TomOP3y ago
i mean the json config file i get from firebase
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server