Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda