Search code examples
chat

In TalkJS, how can I save or load a profile photo for our users if our images are not public?


How can I save or load a profile photo for our users if our images are not public?

Is there a way where I will just pass a photo URL which could be private but accessible within my network for TalkJS to just load in the message conversations?


Solution

  • At the moment in TalkJS it’s not possible to save or load a profile photo for users if the relevant image is not public. The website needs to be able to load the photo.

    Here are two possible workarounds you could use:

    • One workaround would be to make a data: URL for the images, and set those as the profile photo URLs.
    • Another workaround could be that if you are displaying the profile photos on your own site, and if the origin is whitelisted, then you can also whitelist app.talkjs.com.