In Expo, I have a secret called EXPO_BUILD_FIREBASE_API_KEY
. My code to access the secret
const firebaseConfig = {
apiKey: "hard-coded-api-key", //works in testflight (obviously)
// process.env.EXPO_BUILD_FIREBASE_API_KEY ?? //doesn't work in testflight
// process.env.EXPO_PUBLIC_FIREBASE_API_KEY, //works locally and comes .env
In my Expo Build I see
Environment secrets:
EXPO_BUILD_FIREBASE_API_KEY=********
I double-checked that EXPO_BUILD_FIREBASE_API_KEY
contains the correct value, however, in testflight firebase claims that API key is invalid, unless I use the hard-coded key. I am using it like mentioned in the docs.
What could be the reason for this? In .js files I place the API key in quotation marks (“”) while in .env I don’t. My API key contains at least one “-“. Do I need to add escape signs for these? Do I need quotation marks?