Search code examples
firebasereact-nativefirebase-authenticationreact-native-firebase

React-Native-Firebase Create user with Email, passwordless


I am using React Native Firebase to build authentication for my Expo App. I do not want users to have to remember yet another password, so I want to implement passwordless authentication with email link. I cannot find any resource online or documentation in React Native Firebase's website to do this. I see on React Native Firebase's website an API reference to the signInWithEmailLink method but there's no mention of a createUserWithEmailLink or something like that. Does anyone have any suggestions on how to work around this?

Btw, I am using React Native Firebase instead of the simpler Firebase JS SDK because I want to use modules not supported by the Firebase JS SDK on my app.


Solution

  • The React-Native-Firebase libraries wrap the native Firebase SDKs for the platforms they target. So if there's no specific documentation on rnfirebase.io, you can often work from an equivalent in the Firebase documentation.

    Here, I'd recommend using the Firebase documentation on signing in with an email link in web apps.

    From there:

    After a user signs in for the first time, a new user account is created and linked to the credentials...

    So there is no createUserWithEmailLink API, because signing in with an email link doesn't require an explicit sign-up step. The first time the user signs in with the link, their account is created automatically.