I am making a web service with sveltekit and firebase.
By the way, when users save images on firebase storage and other users try to use these images, I want to create a signed url and show it on the page to prevent Hotlink.
I searched and found that there is a function called getSignedUrl that generates a signed url, but there is no official document page that describes it in the firebase document.
Where can I get some example functions or information related to this?
2
Answers
The code below is the code I wrote on firebase functions using Firebase SDK. This code shows you using a function called
getSignedUrl
to write an url with an expiration date. I don't know why the official document doesn't have this information.And, this is the page(captured img) showing Expired Token about url.
The Firebase SDK for Cloud Storage uses a different type of URL, called a download URL. You can generate a download URL by calling
getDownloadURL
with/on a reference to the file, as shown in the documentation on downloading data through a URL.