So, the functionality you want to generate is to determine who is the current logged-in-user on your site, after a user has logged-in onto your site.
Should be something like this one…(this is the FRONT-END-VERSION).
import { currentMember } from 'wix-members';
$w.onReady(async()=>{console.log("Page is ready...");
let options = {fieldsets: [ 'FULL' ]}
let currentMemberData = await currentMember.getMember(options)
const id = currentMemberData._id;
const firstName = currentMamberData.contactDetails.firstName;
const lastName = currentMamberData.contactDetails.lastName;
const fullName = `${firstName} ${lastName}`;
//-------------------------------------------------
console.log("Member-Data: ", currentMemberData);
console.log("Member-ID: ", id);
console.log("Member-Firstname: ", firstName);
console.log("Member-Lastname: ", lastName);
console.log("Member-Fullname: ", fullName);
});