For more information please refer to my blog post
This repository demonstrates how to upload a file to Firebase Storage using Google Cloud Storage sdk. In order to get this working you need the following 0. Install dependencies
npm install
- create a Firebase project.
- Generate a Private Key File from your Firebase project dashboard and place it in the root of the repository.
- Replace keyFileName with the name of your Private Key File
const keyFilename="./my-private-api-key-file.json"; //replace this with api key file
- Find your projectId from your Firebase application dashboard. It should be under the Storage section formatted as such
gs://<PROJECT_ID>.appspot.com
- Replace projectId variable with your PROJECT_ID
const projectId = "my-project-id-should-go-here" //replace with your project id