# How do I retrieve a current member's ID?

**URL:** <https://forum.wixstudio.com/t/how-do-i-retrieve-a-current-members-id/11152>\
**Category:** Ask the community\
**Tags:** wix-members-area, question, code\
**Created:** [May 16, 2023, 9:13pm UTC](https://forum.wixstudio.com/t/how-do-i-retrieve-a-current-members-id/11152 "2023-05-16T21:13:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![internationalcovidsu](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/internationalcovidsu/32/30580_2.png) [@internationalcovidsu](https://forum.wixstudio.com/u/internationalcovidsu)\
**Post date:** [May 16, 2023, 9:13pm UTC](https://forum.wixstudio.com/t/how-do-i-retrieve-a-current-members-id/11152/1 "2023-05-16T21:13:10Z")

</div>

I’m having an issue with retrieving a logged in member’s ID. I’m using the backend function:

import { currentMember } **from** ‘wix-members-backend’

export function myGetCurrentMemberFunction ( ) {  
**return** currentMember . getMember ()  
. then (( member ) =\> {  
**return** member . \_id ;  
})  
. **catch** (( error ) =\> {  
**return** error ;  
})  
}

If I run it from the backend, it fetches the member’s ID correctly. When I call this function from the front end of my published site and the currently logged in member is the owner, it runs correctly. If the owner logs out and someone else logs in, it doesn’t return anything and the rest of the page just doesn’t load. What am I doing wrong?
