---
title: "Discussion on \"The Ultimate Guide To Firebase With Next.JS 🔥\" | Hashnode"
description: "Discussion on \"The Ultimate Guide To Firebase With Next.JS 🔥\". Learn How To Set Up Firebase With Next JS And Create A Cloud Firestore Database, GitHub Authentication, and Firebase Cloud Functions in Next JS."
url: "https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Ultimate Guide To Firebase With Next.JS 🔥](https://blog.jarrodwatts.com/the-ultimate-guide-to-firebase-with-nextjs?utm_source=hashnode&utm_medium=feed)

Learn How To Set Up Firebase With Next JS And Create A Cloud Firestore Database, GitHub Authentication, and Firebase Cloud Functions in Next JS.

May 31, 2021 · 15 min read · blog.jarrodwatts.com  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#firebase](https://hashnode.com/tag/firebase)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Jarrod Watts](https://hashnode.com/@JarrodWatts)

@JarrodWatts · Sydney, Australia

  
[View profile](https://hashnode.com/@JarrodWatts)

Developer Relations Engineer @ Polygon Labs

A software engineer turned developer relations engineer in the web3 space, from Australia 🇦🇺.

## Responses 7

Markdown supported · ⌘↵ to post

[Drive Buss](https://hashnode.com/@drive)

[Apr 29, 2023](https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef/comment/644cd0d9fde15ba8325c1259)

this method is exposing all my sensitive env variables to the browser. I can literally see all NEXT\_PUBLIC env variables in the browser. this is very dangerous.

[Frédéric Lang](https://hashnode.com/@fredlnl)

[Nov 12, 2022](https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef/comment/636f5e69c83b2a23bd2ba9d0)

Your demo app is broken

Here your console error `FirebaseError: Missing or insufficient permissions.` You cannot see who has voted, could be a firebase configuration error !

[Diego Lievano](https://hashnode.com/@Liev08)

[Mar 25, 2022](https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef/comment/623e1ac42209c88a3de90aaf)

In case you are having troubles with the auth:

```
firebase.google.com/docs/web/modular-upgrade
```

firebase updated from v8 to v9, and I followed these steps, and everything worked just fine.

[Ruslan](https://hashnode.com/@rusik)

[Mar 10, 2022](https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef/comment/622a0edfe552e99d82e58acf)

\*NEXT\_PUBLIC\_FIREBASE\_API\_KEY=<your-api-key> NEXT\_PUBLIC\_FIREBASE\_AUTH\_DOMAIN=<your-auth-domain> NEXT\_PUBLIC\_FIREBASE\_PROJECT\_ID=<your-project-id> NEXT\_PUBLIC\_FIREBASE\_STORAGE\_BUCKET=<your-storage-bucket> NEXT\_PUBLIC\_FIREBASE\_MESSAGING\_SENDER\_ID=<your-sender-id> NEXT\_PUBLIC\_FIREBASE\_APP\_ID=<your-firebase-app-id>

Great, now we have all of our configuration values stored in Environment Variables - this means we don't expose our private configuration values to the public! __\* NEXT\_PUBLIC means that you expose the values to public!__

[hem charan](https://hashnode.com/@hemcharan)

[Jan 12, 2022](https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef/comment/61deb1284e70945324c597d5)

i got this error while Installation of firebase which says:

TypeError: Cannot read properties of undefined (reading 'apps')

![error.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1641984205822/L6lXCbt3w.png)

[Mohammed](https://hashnode.com/@mocherfaoui)

[Feb 14, 2022](https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef/comment/61deb1284e70945324c597d5#reply-620a21d821583d1fa4fa7c1b)

are you using Firebase v9?

v9 had a lot of breaking changes and it is modular(tree-shakable) compared to the namespaced v8

learn more here: [firebase.google.com/docs/web/modular-upgrade](https://firebase.google.com/docs/web/modular-upgrade#update_initialization_code)

[Lucas Almeida Siqueira](https://hashnode.com/@lucasalmeida)

[Oct 16, 2021](https://hashnode.com/posts/the-ultimate-guide-to-firebase-with-nextjs/60b5aea65302e8579db4beef/comment/616a4f0418374f257327b45a)

If someone is getting the error:

```
error - ./firebase/clientApp.js
Attempted import error: 'firebase/app' does not contain a default export (imported as 'firebase').
```

Its because `firebaseui-web-react` doesn't support firebase v9 yet :/
