I have a custom member’s page where I would like to print the user’s first name in a string. For example, let’s say the user is called Bob. I would like to print a string which says ‘Hi, Bob!’.
This is my code which I have wrote currently to print the user’s ID. How can I update this code to print the user’s name instead?
import wixUsers from ‘wix-users’ ;
let name = wixUsers.currentUser.id ;
$w . onReady ( function () {
if ( wixUsers.currentUser.loggedIn ) {
$w ( ‘#text293’ ). text = ‘Hi,’ + name + ‘!’ ;
}
});