I am trying to use wix-members-frontend API in Studio to register new members from code, i followed Wix document, and I got the custom field key, but it doesn’t work.
attached is screen document from Velo related documentation and my code. if there any one can help on that
async function signUpSoloist() {
const soloistData = {
soloistFirstName: $w("#soloistFirstNameInput").value,
soloistLastName: $w("#soloistLastNameInput").value,
soloistEmailAddress: $w("#soloistEmailAddressInput").value,
soloistPassword: $w("#soloistPasswordInput").value,
soloistCountry: $w("#soloistCountyInput").value,
};
try {
const soloistSignUpResult = await authentication.register(
soloistData.soloistEmailAddress,
soloistData.soloistPassword,
{
contactInfo: {
'custom.type': "Soloist",
firstName: soloistData.soloistFirstName,
lastName: soloistData.soloistLastName,
picture:
"https://static.wixstatic.com/media/5688df_5595f038dd5f471a89592219109d6c41~mv2.webp",
},
privacyStatus: "PUBLIC",
}
);
console.log(soloistSignUpResult);
}
The code i used to get the field key as per Wix document instructions
import { contacts } from "wix-crm-backend";
export async function listCustomFieldKeys() {
const queryResults = await contacts.queryExtendedFields().find({suppressAuth: true});
// Filters for custom fields (where fieldType is USER_DEFINED), then converts to an array of keys
return queryResults.items
.filter((field) => field.fieldType === "USER_DEFINED")
.map((field) => field.key);
}