Until now, I was saving my Firebase project private keys in the app.json of my React Native app. Like this:
"web": {
"config": {
"firebase": {
"apiKey": "x",
"authDomain": "x.firebaseapp.com",
"databaseUrl": "https://x.firebaseio.com",
"projectId": "x",
"storageBucket": "x.appspot.com",
"messagingSenderId": "x",
...
}
}
},
But looking at the docs, I have seen the following:
WARNING: Do not store any secrets (such as private API keys) in your React app!
Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files.
So, if I shouldn't store secrets in the front-end, how do I use the Firebase client sdk?