Setting up API credentials

Good day guys.

I seek your help with fixing an error in my app code. I’m working on a registration page for my app and I was asked by Gemini to add my API credentials to the .env file. I have added the API (apiKey, authDomain, etc.) to the .env file and ensured they are contained in the quotation marks, but I keep getting the following console error every time I submit the registration form:

FirebaseError: Firebase: Error (auth/configuration-not-found).

src/components/register-form.tsx (153:30) @ async onSubmit

151 | setIsLoading(true);
152 | try {

153 | const userCredential = await createUserWithEmailAndPassword(auth, values.email, values.password);
| ^
154 | const user = userCredential.user;
155 |
156 | await updateProfile(user, {

Concerned that I might have made an error in copying and pasting the API credentials in the .env file, I pasted the API credentials into the chat and asked Gemini to populate the .env file for me - even this failed. Gemini has attempted to fix this more than a dozen times to no avail. Therefore, any help that you can provide towards resolving this issue would be greatly appreciated.

Thanks,
Gerald

Gemini will avoid giving advice on your .env file because it contains sensitive info. .env files essentially store app passwords.

To start, the .env file in Firebase Studio simply contains the Firebase connections (which you can find in the project settings within your Firebase Console) and a Gemini API Key (which you can regenerate in Firebase Studio or you can grab a new one from Gemini AI Studio).

P.S. Don’t store .env files in your code repository (e.g. GitHub) unless the values are encrypted (@dotenvx/dotenvx).