I get an object from my code
const username = await firebase
.database()
.ref("users/" + authUser + "/name")
.once("value")
.then(function(snapshot) {
return snapshot;
});
Its value is "testname". Its logging everything correct to console. But if I try to reuse my username for example in
const url = `https://url.com/users/${username}/${authUser}/posts.json?auth=${token}`;
I get in my console.log
https://url.com/users/[object Object]/...
I am pretty new to firebase and JS but I think I have to transform my object to a string? How to achive this?