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

180
Visualizações
How to emulate Firebase authentication without an API key

I'm building an open-source project using Firebase's JS SDK. My goal is to allow contributors to run the project locally using the Firebase emulator so that they don't need any real credentials. The Firebase emulator docs specify that "you can run the emulators without ever creating a Firebase project". That's exactly what I want!

After running firebase init, I wrote up the following code. It triggers a popup that allows users to sign in through GitHub:

import { initializeApp } from "firebase/app";
import { connectAuthEmulator, getAuth, GithubAuthProvider } from "firebase/auth";

const app = initializeApp({
  projectId: "demo-project",
});

const auth = getAuth(app);
connectAuthEmulator(auth, "http://localhost:9099");

// When users sign in, we call the following method:
async function signIn() {
  const githubAuth = new GithubAuthProvider();
  await signInWithPopup(firebaseClientAuth, githubAuth);
}

The code above will trigger the following error:

Uncaught (in promise) FirebaseError: Firebase: Error (auth/invalid-api-key)

In the real world, I would call initializeApp() with an apiKey, but here I just want to emulate authentication. I've also tried not to call initializeApp() at all and call getAuth() without any arguments, but it triggers the same error.

Presumably, an API key requires creating a project, so is it actually possible to run the Firebase auth emulator without creating a Firebase project?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

is it actually possible to run the Firebase auth emulator without creating a Firebase project?

No, you need to have the emulator connected to a project. You'll notice in the setup instructions you are required to run firebase init to choose your project and the products you want to use in that project.

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