Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!