Skip to main content

How to read a file from Firebase Storage in Firebase Functions

· One min read

Let's say you have a CSV file someone uploads from a UI, that gets saved to Firebase storage; details on how to do this here.

How do you then read and process that file on the server?

You can access the bucket from the firebase-admin library, and then download the file in memory. What you do with the file then is up to you!

import functions from 'firebase-functions';
import { initializeApp } from 'firebase-admin/app';
import { getStorage } from 'firebase-admin/storage';


export const processCSV = functions
timeoutSeconds: 540
.onFinalize(async object => {

const bucket = getStorage().bucket();
const csvFile = await bucket.file(;