사용자 정보 업데이트
사용자의 Username, Profile Image URL을 변경할 수 있습니다.
data의 경우, 최대 5개의 key-value pair를 입력할 수 있습니다. Key의 최대 size는 128자 이고 최대 value size는 1024자입니다. Key, value 둘 다 문자열이어야 합니다.
await client.updateUser({
username: 'user123', // max char length: 128
profileImageUrl:'http://hello.com/1.jpg',
data: {
metadataKey: "metadataValue"
},
})
<input type="file" onchange="uploadFile(this)" >
<script>
async function uploadFile(input) {
// 프로필 이미지를 업로드
await client.updateUser({
username: 'user123', // max char length: 128
image: input.files[0],
data: {
metadataKey: "metadata"
},
});
}
</script>
Response
{
"user": {
"id": "user123",
"username": "user123",
"profileImageUrl": "http://hello.com/1.jpg",
"data": {
"metadataKey": "metadata"
},
"updatedAt": 1583924400,
"createdAt": 1583921400
}
}
Last updated