-
Notifications
You must be signed in to change notification settings - Fork 894
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
FR: Firebase Auth Lite #8284
Comments
Hi @jdgamble555, thanks for the feature request! I am not familiar with Deno and Bun, so I have a quick question: What is missing from Deno and Bun that is preventing users from using Auth as they would in Node? |
Generally speaking all NodeJS dependencies like "os" "fs" "crypto" etc etc... |
If there were something like: import { getAuth } from "firebase/auth/lite"; And it only used the Firebase REST Auth API, that would theoretically solve the problem. J |
At a quick glance I don't think I can find auth code using any of those Node APIs. Specifically, what happens when you try to use firebase/auth in these environments? What errors do you get? I looked through auth's dependencies and I do see a dep on |
That is definitely one. I will see if I can run a test this weekend if there is more than just |
I'm still trying to test this on Cloudflare, but I notice throw ERROR_FACTORY.create(AppError.INVALID_SERVER_APP_ENVIRONMENT); This is due to how The easiest fix for this would be to check for window instead: function isBrowser(): boolean {
return typeof window !== 'undefined';
} J |
I'm also getting "Service auth is not available" from this line. I'm not quite sure what it is checking for. However, this is only when using Qwik. Still testing different frameworks on Cloudflare (which is also what Vercel Edge uses)... |
@hsubox76 - Do you think you guys could fix the J |
update browser detection logic: detect either window or web worker (WorkerGlobalScope). fixes firebase#8299 firebase#8284
update browser detection logic: detect either window or web worker (WorkerGlobalScope). fixes firebase#8299 firebase#8284
update browser detection logic: detect either window or web worker (WorkerGlobalScope). fixes firebase#8299 firebase#8284
update browser detection logic: detect either window or web worker (WorkerGlobalScope). fixes firebase#8299 firebase#8284
Hi @jdgamble555, a change was merged a while ago to address this issue. Also we removed our dependency on Can you try out the latest version and see if this is still an issue? Thanks! |
@DellaBitta - Firebase JS is working now except in Qwik, I get the Please look at this if you can. J |
Hi @jdgamble555, Ok, thanks. I'll close this issue for now and post a reply shortly in the other issue that you've opened. |
Operating System
Windows 11
Browser Version
Chrome Version 125.0.6422.141
Firebase SDK Version
10.12.2
Firebase SDK Product:
Auth
Describe your project's tooling
All JS Frameworks hosted on Bun, Deno, Vercel Edge, or Cloudflare.
Describe the problem
Currently, you can only use Firebase on non-node runtimes by using "Firestore Lite." This means you have to use Firestore Lite when hosting on a Bun, Deno, Vercel Edge, Cloudflare etc server. However, there is currently no way to login using "Firestore Lite," as it requires Firebase Auth. Firebase Auth cannot be run on these servers, while technically Firestore (with REST API) can.
There needs to be a way to login on the server in these environments. This is crucial for non-serverless environments. We don't like cold starts.
Steps and code to reproduce issue
Try hosting any "Firestore Lite" app on one of these servers and using "Firebase Auth" to login server side. At the very very minimum, there should be a way to pass the token from the client the server and login with a method like "signInWithCustomToken".
However, a "Firestore Auth Lite" package that works with
FirebaseServerApp
and uses the AUTH REST API instead of "fs", "stream", "child_process", "crypto", "os", etc... These are usually items that are required with grpc or protobuf protocol that cause problems.There is currently no way to host Firebase in these environments and get past the login firewall. There is currently no way to use "Firestore Lite" with a logged in user in these environments.
J
The text was updated successfully, but these errors were encountered: