I need to get the current loggedIn users and show the count, also when click on button it should open a popup and show the names of current loggedIn users.
I can get the total user but don't know, how to get logged in users
Thanks for the help
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
Try add this to your code if (wixUsers.currentUser.loggedIn === true) {
This CODE goes to the WEBSITE-CODE-SECTION
NOT to the PAGE_CODE_SECTION
Hello little engineer 😁,
take a look on these examples here at my helping site.....
https://russian-dima.wixsite.com/meinewebsite/user-infos
You can modify this code-snipet here....
import wixUsers from 'wix-users'; // ... wixUsers.onLogin( (user) => { let userId = user.id; // "r5cme-6fem-485j-djre-4844c49" let isLoggedIn = user.loggedIn; // true let userRole = user.role; // "Member" } );
...and start your own created function, which will do for example an entry into a database, telling that this current logged in user is ONLINE just right now.
So every USER who loggs in, will be collected in your DATABASE (for example boolean-value --> ONLINE = TRUE/FALSE).