Simple "Logged-in" Verification?

Greetings Gurus.

I want to perform a simple verification of whether or not a page visitor is logged in. I would like to perform this check using a standard button click.

I’m getting a pretty good feel for Velo. I just don’t know where to start. Below is a modified code snippet I found for a verification check on initial page load. I’ll add the button myself.

import wixUsers from 'wix-users';

$w.onReady(function () {
      if(wixUsers.currentUser.loggedIn === true) {
	[some action]
      }
});

Is this all that’s needed? Or am I missing something?

Hello. Wix users is a deprecated API so you will want to review Wix Members

And this specifically is the part of the API that will return the logged in user

Thank you for this. I think I’m good to go!

I will post an update with a working code snippet as soon as I have one.