1

I am using firebase cloud function example https://github.com/firebase/functions-samples/tree/master/generate-thumbnail to generate thumbnails. But here, it didn't mention how to get a public URL of generated thumbnail in node JS.

KENdi
  • 7,576
  • 2
  • 16
  • 31
Harish Reddy
  • 23
  • 1
  • 4

2 Answers2

0

You'll need to generate a download URL for the file (see this answer) and can then download the file in the browser through the Firebase SDK (see this documentation).

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
0

The last line of that firebase sample function actually writes both the full size image url and the _thumb url to the DB under /images/. Which you could grab in your app....

(if you're using firebase db, that is....)

    // Add the URLs to the Database
      return admin.database().ref('images').push({path: fileUrl, thumbnail: 
      thumbFileUrl});
      }).then(() => console.log('Thumbnail URLs saved to database.'));
Sean Rasmussen
  • 313
  • 4
  • 15