PelcroUserUpdated
Fired when user profile is updated
Overview
Fired when a user's profile information is updated. This event is more specific than PelcroUserLoaded - it only fires when profile data actually changes.
Triggered By
| Method | Description |
|---|---|
Pelcro.user.update() | Updating profile information |
Pelcro.user.uploadProfilePicture() | Uploading profile photo |
Pelcro.user.removeProfilePicture() | Removing profile photo |
Pelcro.user.verifyEmailToken() | After email verification |
Pelcro.user.verifyLoginToken() | After passwordless login |
Pelcro.user.resendEmailVerification() | After resending verification |
Event Detail
The event.detail object contains the updated user:
| Property | Type | Description |
|---|---|---|
id | number | User's unique identifier |
email | string | User's email address |
first_name | string | User's first name |
last_name | string | User's last name |
phone | string | User's phone number |
profile_photo | string | URL to profile photo |
email_verified | boolean | Whether email is verified |
Example
document.addEventListener('PelcroUserUpdated', (event) => {
const user = event.detail;
console.log(`Profile updated for: ${user.email}`);
// Update UI with new data
updateProfileDisplay({
name: `${user.first_name} ${user.last_name}`,
avatar: user.profile_photo
});
// Track update
analytics.track('Profile Updated', {
userId: user.id
});
});Related
- Events Overview - All available events
- PelcroUserLoaded - Fires on any user data load
- User Module - User methods
Updated 1 day ago
