gladly-team / next-firebase-auth

Simple Firebase authentication for all Next.js rendering strategies
https://nfa-example-git-v1x-gladly-team.vercel.app/
MIT License
1.34k stars 291 forks source link

Why is databaseURL required during init? #634

Closed borisyordanov closed 1 year ago

borisyordanov commented 1 year ago

Describe the bug I'm unable to provide the databaseURL the init function demands because I don't use Firebase's DBs. Passing an empty string silences the error and the library functions seemingly fine. It seems unnecessary for it to be required.

Versions

next-firebase-auth version: 1.0.0-canary.19 Firebase JS SDK: 9.19.1 Next.js: 13.2.1

To Reproduce Steps to reproduce the behavior:

  1. Call init in a TS file with a firebaseAdminInitConfig that's missing a databaseURL key
  2. Expect a TS error about a missing key

Expected behavior Firebase auth and the Firebase DB are separate services. next-firebase-auth should not require information about a service that my Firebase project doesn't even use.

Debug and error logs image

kmjennison commented 1 year ago

You're right, it shouldn't be required. Firebase docs show databaseURL as optional:

Please feel free to make a PR to update that type!