How to fetch the Preview Image of a Stream

Hey @Dimitrios.Ververidis,

If the stream is public, the url will just work. If you need to access private streams, then you’d need to fetch the image while passing your auth token. If no token is found, it will default to the “This stream is private” image of the Red speckle cube.

In our frontend, you’ll find a component called PreviewImage.vue that has the functionality you are looking for :point_down:

Basically, we fetch the image, create a temporary url for it and assign it to the <img/> src tag.

Notice that if a token exists on that session, we pass it into the headers. If no token exists we try anyway, but request may end up with the red speckle logo :smiley:

Hope that helps! @dimitrie, feel free to correct me if anything I said was not acurate :sweat_smile:

1 Like