Skip to main content

User management

This section explains how to create and update users directly through the JavaScript SDK.

Creating and updating users

The SDK provides methods to create and update user profiles directly from the browser. This functionality must be explicitly enabled in the administration panel's security settings.

Security warning

We recommend using server-side SDKs for user management rather than client-side JavaScript. This prevents potential misuse where malicious actors could create or modify large numbers of user accounts. Only enable this feature when absolutely necessary.

When creating or updating users through the JavaScript SDK:

  • Success triggers mambo.user.create or mambo.user.update events
  • Failures log error messages to the browser console

Example implementation:

JavaScript

User search functionality

The SDK also provides methods to search for users:

JavaScript

You can listen for search results using the event system:

JavaScript

Data model

When creating or updating users, adhere to the following data structure:

FieldDescriptionRequired
uuidUnique identifier for the user (often email)Yes
isMemberWhether user is an active memberNo
pictureUrlURL to user's profile pictureNo
profileUrlURL to user's profile pageNo
details.emailUser's email addressNo
details.displayNameName to display in widgetsNo
details.firstNameUser's first nameNo
details.lastNameUser's last nameNo
details.birthdayUser's date of birth (ISO format)No
details.genderUser's gender (M or F)No
tagIdsArray of tag IDs to associate with userNo
tagTagsArray of tag texts to associate with userNo

For detailed information about the User API, see the Users API documentation.