New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update Firebase adapter to use new API #3873
feat: update Firebase adapter to use new API #3873
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nextauthjs/next-auth/B9LdbAmzy78jXehodwfN8ttCYbf1 [Deployment for 0735258 failed] |
I really appreciate it! Once we finish the migration to a monorepo setup #3650, I'll have a look! My main blocker on my original PR was to figure out how could we integrate with Firebase Authentication's User management. Do you have any ideas? It would certainly be cleaner for Firebase users, but we could also just use Firestore for now and re-visit this later on. I also know people wanted a security rule suggestion, so if you have any, could you add it to the docs at the same time? |
For sure, no worries!
I was thinking about this for while and tried to take a stab at it myself adding it to this adapter. But I gave up after a little because it was like fitting a square peg in a round hole. Firebase Auth acts similarly to this library – providers in
Do you know what kind of suggestion people are looking for? Like rules around the |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Hello. Is there any ETA for the merge? |
Hey @thiras, I think we are still kinda waiting for #3952 to be resolved. Not sure what the status is on that, maybe @balazsorban44 or @ndom91 can enlighten us? |
The monorepo migration has been finished, currently making sure the release pipeline is ready. I'll look into PRs like this when I'm confident about releases. 👍 Thank you for your patience. In the meantime, please test this adapter by copy-pasting it into your projects and see if it works. I see there is a merge conflict, that should be fixed anyway before this could be merged. |
You got it @balazsorban44. I'll go ahead and rebase + test it. Also, it seems like one of the CI checks needs approval by a maintainer before running, would you mind checking that out? EDIT: Updated some deps to the latest and tested locally - looks ✅ |
Hi guys, I just found this and I'm loving it! Sending y'all good energies for a successfull PR! |
Can this adapter work with firebase realtime database? |
This adapter is specifically designed to work with |
Sign in should be done by email provider, and the email provider requires adapter to store verification token. The project itself requires users metadata, and tracking current flow of their progress on their project. I'm not sure whether realtime database is the best solution, still researching. |
Hi guys, any ETA on the merge? |
Normal firestore -like database should be fine for this 👍 |
We fixed the docs failed deploy, should be good to go now. It looks good to me, will try to get the teams support to merge this as soon as possible! |
Thanks for the PR, and sorry for the delay! I'm thinking renaming to Do we see a future with a different Firebase-based adapter? Should we either:
Apart from that, I had some code nitpicks, which I'll hold to myself for now, and can do in a follow-up PR, you have done great work here and I don't want to unnecessarily prolong the merge of this. 😅 |
I do agree with you that it is a little confusing, but I will say it's already confusing as is since this adapter is purely built for Firestore. We've seen the many comments of when Firebase Auth will be added to this adapter and we probably want to make it clear what this adapter actually supports: Firestore.
Unless I'm missing some context y'all might have, the only thing I potentially see is exporting a Firebase Realtime DB adapter. However, I've never worked with it so I don't know if it's even feasible/wanted. In regards to those options:
My recommendation is the 2nd option I proposed, but at the end of the day it's your call. If you don't want to deal with the renaming quite yet, I'll rip it out, just give me the word. We can continue the discussion in #4592.
I appreciate it! I also don't mind tackling them if need be, just let me know. |
Since we're right at the finish line I want to jump in - @chanceaclark do you have a sponsorship link somewhere, GitHub or otherwise? I've been eagerly following this PR for a while now. It'll solve a pile of problems for me, and I'd like to buy you a coffee-or-two as thanks for the months of work. |
I appreciate the offer @cdriesler! However, I don't have anything setup for sponsorship currently and I'm doing this for the fun of it 😄 Maybe in the future, but for right now, just giving back to the community 🙇♂️ |
BREAKING CHANGE: Requires firebase v9+
BREAKING CHANGE: Renames FirebaseAdapter export to FirestoreAdpater.
When will this version be available in npm? |
Good news, this is now available as Let us know if you have any issues! |
i just created new project and now have problem with firebaseAdapter: |
Is this part of a new issue? |
Ports and refactors
adapter-firebase
to use new Adapter API. Ported from this PR: nextauthjs/adapters#183Breaking Changes:
FirebaseOptions
emulator
options to connect to Firestore emulatorReasoning 💡
Uses new firebase modular + adapter api.
Checklist 🧢
Affected issues 🎟
Closes #3827
cc. @balazsorban44