Firebase apps with next-firebase-auth Starter Code #136
shreyas-jadhav
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Guys!
From past few weeks, I was working with
next-firebase-auth
and Firebase apps. No doubt it's a great library, but as a not so pro developer I wasted a lot of time finding examples, solving error to make Firebase Apps work well with Next.js.Most terrible issue I faced was caused by accidentally using Admin SDK in my client side. And I literally no idea or traves, why I was getting errors. I wasted a lot of time finding an examples how to make work Firebase Apps with
next-firebase-auth
. I found some answers here, turned out it was dead simple.Then, I had to find way to implement with Firebase Cloud Messaging, as the official examples didn't provide sufficient way to make it work with their Firestore example. I was getting missing
appId
error, after 24 hours of searching why this error. I found out that I need to pass the same credentials in theinitAuth.js
as well while initialising.There wasn't a single example to make all Firebase Apps work together. After a few day, I finally made one by myself! And I hope it would help a lot of you guys, if you are making one of such projects or plan to.
Just grab my template and start working. I have the Auth(Protected pages, login custom element) already setup, Project structure for Firestore (references/functions/client-admin SDKs) already setup, and even Firebase Cloud Messaging (service workers, get-token) setup already! I guess this would save someone's a hell of a lot of time, especially beginners.
Just add you environment variables and you have everything working already!
Check out the demo and here's my template repository - next-firebase-starter.
Enjoy!
Beta Was this translation helpful? Give feedback.
All reactions