Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

511
Visualizações
How to I fix invalid firebase api key?

In a react firebase project I am getting the error = " firebase: error (auth/api-key-not-valid.-please-pass-a-valid-api-key.)" Why am I getting this error?

Here is my firebase initializing code:

import { initializeApp } from "firebase/app";
import { getAuth } from 'firebase/auth';
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey:process.env.REACT_APP_authDomain,
  authDomain:process.env.REACT_APP_apiKey,
  projectId:process.env.REACT_APP_projectId,
  storageBucket:process.env.REACT_APP_storageBucket,
  messagingSenderId:process.env.REACT_APP_messagingSenderId,
  appId:process.env.REACT_APP_appId
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);

const auth = getAuth(app);


export default auth;
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

  1. In the .env file where you put all the firebase given api keys put those keys in a formate like below. No extra punctuation.

    REACT_APP_authDomain = YOUR_FIREBASE_KEY

  2. Check all the api keys are OK

  3. If all things are OK. Stop your 'react hotreload' and start your react app again by 'npm start'

At last I am seeing that you are providing wrong value for keys. You have provided 'apikey' the 'REACT_APP_authDomain' value and authDomain the 'REACT_APP_apiKey' value. Check that also. Good luck 🤞.

apiKey:process.env.REACT_APP_authDomain,
authDomain:process.env.REACT_APP_apiKey
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda