Hey Guys
I am trying to add a users functionality into my site - this functionality will have to keep some persistent data across sessions (lets assume accumulating points for example)
I am trying to figure out the best architecture for this - should I create my own users DB? I saw there is a specific wix users ( https://www.wix.com/code/reference/wix-users.htmlhttps://www.wix.com/code/reference/wix-users.html ) functionality - but I didn’t fully understand it (or find an implementation articles/examples - are there any?) does it mask a users table? where is this registered? should I create a designated table for it? what is the specification?
Thanks so much
Kobi
1 Like
Hey
You can’t actually see or add fields to the built-in users tables. But you cann extend it by creating your own collection and connecting the userID from the currently logged in user to a user_id field in your own collection. This way you add fields for anything, like profiles and more connected to the users functionality in WIX.
Use the built in users system because you can use settings in pages and apps that uses this functions so creating your own is not recommended.
Does this answer your question? If not I will try to help you more.
The general way to do it is to create a collection to store the per-user data.
one of the fields will be the user’s ID (or email if you prefer).
using wix-users you can get the current user’s details and use them to insert stuff to the collection.
an interesting point to consider is permissions - who is allowed to set user data.
if you provide a bit more info on the use case we can discuss how to do it right.
good luck!
Thanks guys - I am still kind of confused
Lets assume that I don’t need anything but the fields that available in wix users - i.e. - a specific ID, an e-mail and a role.
should I still create a table - or is wix-users is taking care for it?
if so - how do I set the functionality of inserting a new users - I cant see any documentation for inserting a user to somewhere - something that will capture a user e-mail for example and send it a DB field (or send it to some kind of user constructor)
Thanks
Kobi
You do it this way:
- You protect one or more pages to be members only and then you can add the WIX Widget for members Login/Signup from the widgets library.

It is the yellow one sorry for swedish 
- You popup the login dialog from code.
https://www.wix.com/code/reference/wix-users.html#promptLogin
Then your visitors will be asked to register (then they will be added to your site) or login. You can see all users under your dashboard and contacts. You can set what role they will get and if you want auto approval or manual approval on users.
Look at the members functionality and watch those on Youtube on the WIX channel.
Best of luck!
Thanks guys - I found the add login button - and some videos showing a bit more about the functionality
I have couple of other questions that I hope you can aid me with…
- Lets assume I want to capture some more data about the people - their first name, age etc’ - is the login page editable? should I create a new one ?
- lets assume that when a user sign-up I want something to happen - can I create some kind of a “on button clicked” function for the “go” button on the registration page?
- Is it possible to have the login page as some kind of a floating form and not a different pages?
Thanks
Kobi