React Native FirebaseUI Auth
raw JSON → 2.0.0 verified Sat Apr 25 auth: no javascript
A React Native library that wraps FirebaseUI Authentication, providing a drop-in UI for sign-in methods (email, Google, Facebook, anonymous) on iOS and Android. Version 2.0.0 updates Android dependencies and is compatible with React Native >=0.59.0. Ships TypeScript types. Key differentiators: uses native FirebaseUI SDKs for consistent look-and-feel, supports auth state event listeners, and allows automatic upgrade of anonymous users.
Common errors
error Cannot find module 'react-native-firebaseui-auth' ↓
cause Package not installed or import path incorrect.
fix
Run
npm install react-native-firebaseui-auth or yarn add react-native-firebaseui-auth. error TypeError: Auth.signIn is not a function ↓
cause Incorrect import – likely used { Auth } named import instead of default.
fix
Use
import Auth from 'react-native-firebaseui-auth' instead of import { Auth } from .... error undefined is not an object (evaluating 'AuthEventEmitter.addListener') ↓
cause AuthEventEmitter imported incorrectly as default.
fix
Use
import { AuthEventEmitter } from 'react-native-firebaseui-auth'. error Module 'react-native-firebaseui-auth' has no exported member 'AuthEvents' ↓
cause Importing AuthEvents as default or wrong path.
fix
Ensure import:
import { AuthEvents } from 'react-native-firebaseui-auth'. Warnings
breaking Version 2.0.0 updates Android dependencies, may conflict with existing Firebase/AndroidX setup. ↓
fix Ensure your project uses compatible Firebase and AndroidX versions. Update android/build.gradle as needed.
deprecated v1.3.46 renamed `delete` to `deleteUser`. The old `delete` method is removed. ↓
fix Replace calls to `Auth.delete()` with `Auth.deleteUser()`.
gotcha Package uses ESM only. Using require() or CJS syntax will fail at runtime. ↓
fix Use ES import syntax: `import Auth from 'react-native-firebaseui-auth'`.
gotcha AuthEventEmitter and AuthEvents are named exports, not part of default export. ↓
fix Import with `import { AuthEventEmitter, AuthEvents } from 'react-native-firebaseui-auth'`.
gotcha React Native >=0.60 uses autolinking, no manual linking needed. Linking steps for <=0.59 only. ↓
fix For RN >=0.60, simply install the package; no react-native link required.
Install
npm install react-native-firebaseui-auth yarn add react-native-firebaseui-auth pnpm add react-native-firebaseui-auth Imports
- Auth wrong
const Auth = require('react-native-firebaseui-auth')correctimport Auth from 'react-native-firebaseui-auth' - AuthEventEmitter wrong
import AuthEventEmitter from 'react-native-firebaseui-auth'correctimport { AuthEventEmitter } from 'react-native-firebaseui-auth' - AuthEvents wrong
const { AuthEvents } = require('react-native-firebaseui-auth')correctimport { AuthEvents } from 'react-native-firebaseui-auth'
Quickstart
import Auth, { AuthEventEmitter, AuthEvents } from 'react-native-firebaseui-auth';
// Listen for auth state changes
componentDidMount() {
this.listener = AuthEventEmitter.addListener(
AuthEvents.AUTH_STATE_CHANGED,
(event) => {
console.log('User:', event.user);
}
);
}
componentWillUnmount() {
this.listener.remove();
}
// Configure sign-in providers
const config = {
providers: ['email', 'google', 'facebook', 'anonymous'],
};
// Start sign-in flow
Auth.signIn(config)
.then((result) => console.log('Signed in:', result.user))
.catch((error) => console.error('Auth error:', error));