Gathering detailed insights and metrics for firebaseui-angular-auth-emulator-fork
Gathering detailed insights and metrics for firebaseui-angular-auth-emulator-fork
Gathering detailed insights and metrics for firebaseui-angular-auth-emulator-fork
Gathering detailed insights and metrics for firebaseui-angular-auth-emulator-fork
A wrapper for FirebaseUI in Angular
npm install firebaseui-angular-auth-emulator-fork
Typescript
Module System
Node Version
NPM Version
TypeScript (84.98%)
JavaScript (11.14%)
HTML (3.55%)
SCSS (0.33%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
303 Stars
237 Commits
70 Forks
14 Watchers
4 Branches
13 Contributors
Updated on Jun 08, 2025
Latest Version
5.2.1
Package Id
firebaseui-angular-auth-emulator-fork@5.2.1
Unpacked Size
109.19 kB
Size
22.84 kB
File Count
21
NPM Version
6.14.6
Node Version
14.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
5
Angular | Firebase | AngularFire | FirebaseUI | FirebaseUI-Angular |
---|---|---|---|---|
11.0.2 | ^8.2.4 | ^6.1.1 | ^4.7.3 | 5.1.x Use auth emulator 🤓 |
11.0.2 | ^8.1.1 | ^6.1.1 | ^4.7.1 | 5.1.1 |
10.2.2 | ^8.0.1 | ^6.0.4 | ^4.7.1 | 5.1.0 |
~8.2.13 | ^7.23.0 | ~5.2.1 | ~4.7.1 | ~4.0.1 |
Version combinations not documented here may work but are untested.
To install this library, run:
1$ npm install firebaseui-angular --save
To run this library you need to have AngularFire2, Firebase, FirebaseUI-Web installed. Fast install:
1$ npm install firebase firebaseui @angular/fire firebaseui-angular --save
Add the FirebaseUIModule
with the config to your imports. Make sure you have initialized AngularFire correctly.
1import {BrowserModule} from '@angular/platform-browser'; 2import {NgModule} from '@angular/core'; 3import {FormsModule} from '@angular/forms'; 4import {AppComponent} from './app.component'; 5import {firebase, firebaseui, FirebaseUIModule} from 'firebaseui-angular'; 6import {environment} from '../environments/environment'; 7import {AppRoutingModule} from './app-routing.module'; 8import {AngularFireModule} from '@angular/fire'; 9import {AngularFireAuthModule, USE_EMULATOR as USE_AUTH_EMULATOR} from '@angular/fire/auth'; 10 11 12const firebaseUiAuthConfig: firebaseui.auth.Config = { 13 signInFlow: 'popup', 14 signInOptions: [ 15 firebase.auth.GoogleAuthProvider.PROVIDER_ID, 16 { 17 scopes: [ 18 'public_profile', 19 'email', 20 'user_likes', 21 'user_friends' 22 ], 23 customParameters: { 24 'auth_type': 'reauthenticate' 25 }, 26 provider: firebase.auth.FacebookAuthProvider.PROVIDER_ID 27 }, 28 firebase.auth.TwitterAuthProvider.PROVIDER_ID, 29 firebase.auth.GithubAuthProvider.PROVIDER_ID, 30 { 31 requireDisplayName: false, 32 provider: firebase.auth.EmailAuthProvider.PROVIDER_ID 33 }, 34 firebase.auth.PhoneAuthProvider.PROVIDER_ID, 35 firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID 36 ], 37 tosUrl: '<your-tos-link>', 38 privacyPolicyUrl: '<your-privacyPolicyUrl-link>', 39 credentialHelper: firebaseui.auth.CredentialHelper.GOOGLE_YOLO 40}; 41 42@NgModule({ 43 declarations: [ 44 AppComponent 45 ], 46 imports: [ 47 BrowserModule, 48 FormsModule, 49 AppRoutingModule, 50 AngularFireModule.initializeApp(environment.firebaseConfig), 51 AngularFireAuthModule, 52 FirebaseUIModule.forRoot(firebaseUiAuthConfig) 53 ], 54 providers: [ 55 { provide: USE_AUTH_EMULATOR, useValue: !environment.production ? ['localhost', 9099] : undefined }, 56 ], 57 bootstrap: [AppComponent] 58}) 59export class AppModule { 60} 61 62 63 64
Option 1: CSS Import
May be incompatible with older browsers.
Import the firebaseui css to your src/styles.css
file:
1@import '~firebaseui/dist/firebaseui.css';
Option 2: Angular-CLI
File: angular.json
Path: "node_modules/firebaseui/dist/firebaseui.css"
1{ 2 "projects": { 3 [your-project-name]: { 4 ... 5 "architect": { 6 "build": { 7 "options": { 8 ... 9 "styles": [ 10 "src/styles.css", 11 "node_modules/firebaseui/dist/firebaseui.css" 12 ] 13 } 14 }, 15 ... 16 "test": { 17 "options": { 18 ... 19 "styles": [ 20 "src/styles.css", 21 "node_modules/firebaseui/dist/firebaseui.css" 22 ] 23 } 24 } 25 } 26 } 27 } 28}
Option 3: HTML Link
Put this in the <head>
tag of your index.html
file:
1<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/3.0.0/firebaseui.css" />
Make sure the version number matches the version of firebaseui you have installed with npm.
Once everything is set up, you can use the component in your Angular application:
1<firebase-ui></firebase-ui>
For the configuration of the module see the official firebaseui documentation: Config
If you use a version prior to 3.3.0 check the old README
To configure the plugin the first time (main.module.ts
) the forRoot()
method is used.
It builds the basis for all further uses of the plugin.
But you have the possibility to overwrite the entire or just parts of the configuration in any (sub-)module.
To overwrite the entire configuration use:
FirebaseUIModule.forRoot(firebaseUiAuthConfig: NativeFirebaseUIAuthConfig)
To overwrite just parts of the configuration use:
FirebaseUIModule.forFeature(firebaseUiAuthConfig: NativeFirebaseUIAuthConfig)
This will use the in forRoot
provided configuration and overwrite just the newly provided values.
1this.angularFireAuth.authState.subscribe(this.firebaseAuthChangeListener); 2 3private firebaseAuthChangeListener(response) { 4 // if needed, do a redirect in here 5 if (response) { 6 console.log('Logged in :)'); 7 } else { 8 console.log('Logged out :('); 9 } 10 }
Don't forget to unsubscribe at the end.
1<firebase-ui 2 (signInSuccessWithAuthResult)="successCallback($event)" 3 (signInFailure)="errorCallback($event)" 4 (uiShown)="uiShownCallback()"></firebase-ui>
1successCallback(signInSuccessData: FirebaseUISignInSuccessWithAuthResult) { 2 ... 3} 4 5errorCallback(errorData: FirebaseUISignInFailure) { 6 ... 7} 8 9uiShownCallback() { 10 ... 11}
1constructor(private firebaseuiAngularLibraryService: FirebaseuiAngularLibraryService) { 2 firebaseuiAngularLibraryService.firebaseUiInstance.disableAutoSignIn(); 3}
Step 1: Fork and clone the repo from Github.
Step 2: There is a sample project in the root folder. Execute the following command in the root folder i.e. .../FirebaseUI-Angular > npm install
Step 3: Ensure that you are using Angular CLI version >10. You can check your version with ng --version
in the terminal.
Step 4: Replace with your firebase config in src\environments\environment.ts
.
Step 5: .../FirebaseUI-Angular > npm run build-lib
Step 6: .../FirebaseUI-Angular > ng serve
You're welcome to fork the repo and contribute to library sources in projects
> firebaseui-angular-library
> src
> lib
.
There are test files, but they are empty at the moment. Writing unit test is a good start.
The UI only gets rendered if the user isn't signed in. So if the UI isn't shown, sign out the user via angular-fire.
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve 'firebase/index' in '...'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve 'firebaseui/dist/index' in '...'
Use the firebase and firebaseui instances exposed by the plugin:
import {..., firebase, firebaseui} from 'firebaseui-angular';
If you have added the css to the angular.json but nothing happened. Try to restart the server (Ctrl-C
and ng serve
)
This is a know issue in the firebase project. To fix that (for now), do that:
npm install promise-polyfill --save-exact
http://localhost:4200/images/buffer.svg?embed
404 (Not Found)Put this into your styles.scss file:
@supports (-webkit-appearance:none) {
.mdl-progress:not(.mdl-progress--indeterminate):not(.mdl-progress--indeterminate) > .auxbar,
.mdl-progress:not(.mdl-progress__indeterminate):not(.mdl-progress__indeterminate) > .auxbar {
mask: url(/assets/images/buffer.svg?embed) !important;
}
}
and put a buffer.svg
file into assets/images
.
This will stop this error message.
MIT © Raphael Jenni
No vulnerabilities found.
No security vulnerabilities found.