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

202
Vistas
auth.signOut() or signOut(auth). Is there any difference or major advantage with any of them?

Is there any difference or major advantage with using auth.signOut() or signOut(auth) of them? This principle for sure also affects the same pattern for logging in, signing up, and so on. The firebase documentation (Web9) only uses the approach with functions signOut(auth). But most articles or tutorials using auth.signOut(). I guess it's a very basic question but I've seen everyone approaching it differently so I'm glad to solve this in the best way possible.

firebase.js

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

const firebaseConfig = {
  apiKey: "",
  authDomain: "",
  projectId: "",
  storageBucket: "",
  messagingSenderId: "",
  appId: "",
  measurementId: "",
};

const app = initializeApp(firebaseConfig);

export const auth = getAuth(app);
export default app;

Auth1.js

import { auth } from "./firebase.js";

// Option 1
function logout() {
  return auth.signOut();
}

Auth2.js

import { signOut } from "firebase/auth";
import { auth } from "./firebase.js";

// Option 2
function logout() {
  return signOut(auth);
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The .js firebase SDK has a version 9 with is a major refacto to lighten the lib and bring a lot of new features (tree-sharing for eg).

auth.signOut is version 8, doc here
signOut(auth) is version 9, doc here

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