This is the code that worked
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
// …
$w.onReady(function(){
$w('#register').onClick(function (){
let email = $w(‘#email’).value;
let password = $w(‘#password’).value;
let firstName = $w(‘#firstName’).value;
let lastName = $w(‘#lastName’).value;
let phone = $w(‘#phone’).value;
wixUsers.register(email, password, {
contactInfo: {
“firstName”: firstName,
“lastName”: lastName,
“phones”: [phone]
}
} )
.then(()=>{
wixLocation.to('/my-account');
} )
})
})