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.
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.createormambo.user.updateevents - Failures log error messages to the browser console
Example implementation:
User search functionality
The SDK also provides methods to search for users:
You can listen for search results using the event system:
Data model
When creating or updating users, adhere to the following data structure:
| Field | Description | Required |
|---|---|---|
| uuid | Unique identifier for the user (often email) | Yes |
| isMember | Whether user is an active member | No |
| pictureUrl | URL to user's profile picture | No |
| profileUrl | URL to user's profile page | No |
| details.email | User's email address | No |
| details.displayName | Name to display in widgets | No |
| details.firstName | User's first name | No |
| details.lastName | User's last name | No |
| details.birthday | User's date of birth (ISO format) | No |
| details.gender | User's gender (M or F) | No |
| tagIds | Array of tag IDs to associate with user | No |
| tagTags | Array of tag texts to associate with user | No |
For detailed information about the User API, see the Users API documentation.