const bucket = storage.bucket(bucketName);
const file = bucket.file(filename);
const publicUrl = file.publicUrl();
There's actually a PR for this! https://github.com/googleapis/nodejs-storage/pull/1339
It still not working. I got undefined when I call file.publicUrl.
It still not working. I got undefined when I call file.publicUrl.
@soraxtend is your file already public? It can be made public by calling await storage.bucket(bucketName).file(filename).makePublic();
Most helpful comment
There's actually a PR for this! https://github.com/googleapis/nodejs-storage/pull/1339