Supply authenticated Images as custom Avatar URL to updateCurrentUser()

My images sit behind a protected API route/url (i.e requires secret Basic Authentication credentials). Is there any way to supply “Authorization” headers to the avatarCustomUrl field such that the Authenticated images are fetched properly.

Or maybe I could fetch my protected image separately with necessary credentials and then supply the Image blob to the Amity Client ?

Is there any way to achieve this ?

@webo May we please confirm your platform & version? Thank you

Our UI Kit is for the Web Open Source, found here GitHub - AmityCo/Amity-Social-Cloud-UIKit-Web-OpenSource

Our Amity JS SDK is “@amityco/js-sdk”: “^5.32.0”,

Our Application is a plain Create React App template based on React 17.

Hey @webo,

You could possibly do something like this. Fetch the authenticated image separately, get a fileId for the image (by using the sdk method). Use this fileId to update the avatar of the user.

Is this a viable option?

The SDK uses the authorization header currently, so this might not be a viable option.

How do I generate a fieldId for my protected images ? I found this, but there aren’t any examples for Javascript. Could you please maybe provide me a working Web Javascript SDK example to upload image ?

I think protected images will need to be fetched prior to uploading and generating a fileId.

You could try this api