Import picture using wixUsers.register()

Hi everyone !
I would like to know if it’s possible to add a picture on the object contactInfo when using :

wixUsers.register(email, password, contactInfo);

If so, can you guide me on how to do it ?

Also, I can’t find the ID of the columns on my member’s database, is there any way I can set it up properly ?

Thank you so much !


You have first to make it visible in your database!

Thank you ! However, which database is it ? I only have PrivateMembersData and I can’t make any modifications

If you are using the Wix Members app on your site, then this will automatically add the Members/privateMembersData collection.
https://support.wix.com/en/article/corvid-wix-members-privatemembersdata-collection-fields

This collection does have a picture field, however it is what the user themselves adds on their profile page.
https://support.wix.com/en/article/corvid-wix-members-privatemembersdata-collection-fields#picture-picture

You can read more about the profile picture here.
https://support.wix.com/en/article/adding-a-members-area-to-your-site

Also, when you register, the contact info goes underneath the email and password as in the API example.
https://www.wix.com/corvid/reference/wix-users.html#register

Register a user as a site member with registration options

import wixUsers from 'wix-users';

// ...

let email = // the user's email addresses
let password = // the user's password
let firstName = // the user's first name
let lastName = // the user's last name
let phone =  // the user's phone number
let nickname = // the user's nickname

wixUsers.register(email, password, {
    contactInfo: {
        "firstName": firstName,
        "lastName": lastName,
        "phone": phone,
        "nickname": nickname
    }
  } )
  .then( (result) => {
    let resultStatus = result.status;
  } );

You can add it through contact info as shown in Wix CRM API.

ContactInfo
An object that contains information about a site contact.

Syntax
type ContactInfo = {
  firstName: string
  lastName: string
  picture: string
  emails: Array<string>
  loginEmail: string
  phones: Array<string>
  labels: Array<string>
  language: string
  customFields: string | number | Date

You can add a upload button to your Corvid signup lightbox.

Note that it will be string as stated in the contact info above as you are using the uploadedFile URL and not the actual image. This is because when you upload something to your site, Wix automatically creates a URL for it.

Finally, if you want more info about the user than what is on the My Account page or their profile page, then check out this member profile tutorial.

Note that the My Account page in the Wix Members app shows a community page URL link and this is the profile page that each member can add info about themselves, however note that this profile page is accessible by other logged in site members and it is what is shown to other members when they view that members profile in the Blog or Forum app for example.

Thank you so much ! I will carefully read all of that :slight_smile: