Before you get Started with Firebase Storage inside your NextJS App


Be sure to update your bucket’s CORS policies to allow connecting from your origin via the http request methods you are using.

First, install the gcloud SDK. Then run the following to login.

gcloud init

Then navigate to the directory where your preferred CORS JSON settings are stored. Then run the following and replace cors.json with the filename of your cors JSON.

gsutil cors set cors.json gs://<project slug>

Bucket Permissions

In your Firebase console navigate to Storage -> Rules. Use the following settings, replacing <project slug> with your project slug.

service {
    match /b/<slug> {
        match /{allPaths=**} {
            // Allow access by all users
            allow read, write;