Reputation:
I have 3 web applications in my firebase project, dev, stg and prod. In my front end project, I configured it so that each environment uses an appId. I want to be able to know from which appId is the user authenticated. Is that possible ?
Upvotes: 1
Views: 12064
Reputation: 89
I know this might be late but it might help others still looking for an answer.
You can get your appId
in the apps section under project settings
Open your firebase console and go to project settings from here ->
Under General, scroll down to your apps section and you'll find appids for each app of yours
Upvotes: 2
Reputation: 83183
You'll find this info in the FirebaseApp
options
object which, among others, contains the appId
.
For example with the JS SDK v9:
import { getAuth, onAuthStateChanged } from "firebase/auth";
const auth = getAuth();
onAuthStateChanged(auth, (user) => {
if (user) {
console.log(auth.app.options.appId);
} else {
// User is signed out
// ...
}
});
Upvotes: 3