When trying to implement signInWithEmail
with Deno, I found out that the Firebase utilities (sendEmailSignInLink, handleEmailSignIn) used libraries requiring node:process or node:buffer, which are incompatible with Deno, according to the error message when testing the implementation. Using sendSignInLinkToEmail
and signInWithEmailLink
firebase utilities gives me 404 Error for node:process
and node:buffer
. (these Node.js modules are apparently not supported by Deno).
How can I replace Node.js-specific dependencies with Deno-compatible alternatives?
As Doug commented already, the Firebase Admin SDKs for use in backend processes don't have any methods to sign a user in, while the Firebase SDKs for use in front-end processes typically won't work in many backend environments.
If there's no SDK for an environment, you can consider calling the REST API for Firebase Authentication, although I don't see any methods to send an email sign-in link there at first glance.
My recommend for this is always the same: use the Firebase client-side SDKs in your client-side application code, rather than trying to rebuild part of that functionality in your own server. If you need to know what user is using your app on the server, you can retrieve the ID token on the client, send it securely to the server, and verify it there.