Sync Member registration form with Contacts?

This is what I use on a site and it all works fine.

Make sure that you have added the custom fields to your Contact List before doing this.
https://support.wix.com/en/article/adding-custom-fields-to-contacts

Also, when you work with custom fields in your Contact List, they must be written in the exact same way that you have added them.

So if your ‘how they heard’ field is written with caps at the start like this ‘How They Heard’, then it must be written in like that in your code.

This works perfectly and closes after registering details before moving the user onto the signup status page, then both names will be saved in Contacts from the Dashboard and once site member is manually approved by the client, the member details will be added to ‘members’ database which is from this tutorial here.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

You can read more about it here in Wix Users API and the register function.
https://www.wix.com/corvid/reference/wix-users.html#register

Signup Lightbox

import wixUsers from 'wix-users';
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';

$w.onReady(function () {
    
    $w("#registerButton").onClick( (event) => {
        
   let email = $w("#email").value;
   let password = $w("#password").value;
   let first = $w("#firstName").value;
   let last = $w("#lastName").value;

   wixUsers.register(email, password, {
       contactInfo: {
        "firstName": $w('#firstName').value,
        "lastName": $w('#lastName').value
       }
      } )
      .then( (result) => {
        let resultStatus = result.status;
  wixWindow.lightbox.close();
  wixLocation.to("/sign-in-status");  //Change the URL ending to whatever page you want to send the user to after they log in.
      } );     
    } );
    
});