Ad

Get Clean URL From Firebase Storage (without Token)

I'm developing a project where I need to send images url to Shopify admin API, the problem I'm having is that shopify doesn't recognize the URL as valid because of the trailing parameters

image.jpg?alt=media&token=9dab5705-351c-44f2-81a6-fc1b4b6eaf56

My question is:

  1. Is there a way to generate clean URL with firebase storage?

  2. if not, is there a work around? like somehow create a proxy script www.scripturl.com/fakeimageurl.jpg and retrieve firebasestorageurl.com/realimage.jpg?alt=media&token=9dab5705-351c-44f2-81a6-fc1b4b6eaf56 with it?

The project is with nodejs.

Ad

Answer

If the images are public, you can use the public url, which will end with your file's extension

storage.googleapis.com/[BUCKET_NAME]/[OBJECT_NAME]
[BUCKET_NAME].storage.googleapis.com/[OBJECT_NAME]

Firebase storage uses google cloud storage under the hood, and you can use any of the mechanisms available there, this documentation explains some reference URIs

Ad
source: stackoverflow.com
Ad