Update user profile image

Plugin Development
  • Im wondering if there is a way for me to update the user profile image like updating the user email adress, or user full name

    User.setUserField(uid, 'email', '[email protected]');
    

    or

    User.setUserField(uid, 'fullname', 'My Full Name');
    

    or

    User.setUserField(uid, 'aboutme', 'Small text description about me');
    

    Let's say I have a new profile image URL (I have a URL). Is there a function I can call to update the users profile image to the one I have in the URL?

  • I suggest using user.updateProfile to make these changes, since it updates the necessary sorted sets for email/fullname.

    You can use the same function to update the picture url as well.

    await User.updateProfile(callerUid, {
    	uid: targetUid,
            uploadedpicture: url,
    	picture: url,
    }, ['uploadedpicture', 'picture']);
    

Suggested Topics