How to get loggedin member information from the backend

I have added this code to my backend


import {currentMember} from 'wix-members-backend';

export function callmember(options){
  return currentMember.getMember(options)
  .then((member)=>{
    const memberId = member._id;
    const fullName='${member.contactDetails.firstName}${member.contactDetails.lastName}';
    const memberProfilePage = 'https://mysite.com/profile/${member.profile.slug)/profile';
    return member;
  })
  .catch( (error) => {
      console.error(error);
      });
  
  
}
//let userId = user.id;
//let isLoggedIn = user.loggedIn;

and called it inside the

export function get_myFunction(request) {
................
callmember(options)}

but it returns an empty object, please any help with this?

This here, works for me:

export async function callmember() {
    let options = {
        fieldsets: ['FULL']
    }
    const member = await currentMember.getMember(options)
    return member
}

@bwprado Thanks for the response, I am using a GET request for users to access the backend of my from another site to determine if they are loggedin…Will this work? Or should the user be on my site?

I did not fully understand what you want to do. You can create a Rest API using the http-functions API, is that what you need?