Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get clean URL from firebase storage (without token)

Tags:

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.

like image 443
Ricardo Chen He Avatar asked Aug 01 '17 16:08

Ricardo Chen He


1 Answers

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

like image 75
AsifM Avatar answered Oct 11 '22 16:10

AsifM