I'm tring to get the authentificated users from firebase
I can get all the users from Database but the key is an id and i need email
this is the code i use in ReactJS to get the users from database
import firebase from "firebase"; import React from "react"; import "./App.css";
const config = { apiKey: ..., authDomain: ... ,databaseURL: ..., projectId: ..., storageBucket: , messagingSenderId: ..., appId: ...};
firebase.initializeApp(config);
function App() {
const itemsRef = firebase.database().ref("users");
itemsRef.on("value", (snapshot) => {
let items = snapshot.val();
console.log(items); // log the users but with id, need email
});
return (
...
);
}
items is an array with data like this
"3yDtn8xZJVUFOlsQgSJsku6SfXx2" : {
"trips" : {
"-Lyut2ozCnkDJo-OLUcI" : {
"arrival_country" : "Afghanistan",
"arrival_date" : "2020-01-19T01:01:42.743+02:00",
"created_at" : 1579388517837,
"departure_country" : "France",
"departure_date" : "2020-01-19T01:01:42.744+02:00",
"name" : "123",
"residence_country" : "Algeria",
"status" : 0,
"trip_name" : "123"
}
}
},
how to get the emails ( or more info) of users ?