firebasefirebase-storagesigned-url

How can I generate signed URLs for accessing Firebase Storage images?


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?


Solution

  • 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.