{"id":22100082,"url":"https://github.com/raphaeljenni/firebaseui-angular","last_synced_at":"2025-05-15T02:06:54.168Z","repository":{"id":40625795,"uuid":"88759874","full_name":"RaphaelJenni/FirebaseUI-Angular","owner":"RaphaelJenni","description":"A wrapper for FirebaseUI in Angular","archived":false,"fork":false,"pushed_at":"2024-11-19T20:21:58.000Z","size":2294,"stargazers_count":305,"open_issues_count":13,"forks_count":70,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-14T23:44:06.995Z","etag":null,"topics":["angular","angularfire2","firebase","firebase-auth","firebaseui"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RaphaelJenni.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.MD","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.buymeacoffee.com/raphaeljenni"]}},"created_at":"2017-04-19T15:18:22.000Z","updated_at":"2025-02-10T02:07:52.000Z","dependencies_parsed_at":"2023-02-18T03:31:22.995Z","dependency_job_id":"4cfd9fd5-22e7-413c-ab83-26c245e79781","html_url":"https://github.com/RaphaelJenni/FirebaseUI-Angular","commit_stats":{"total_commits":194,"total_committers":20,"mean_commits":9.7,"dds":0.654639175257732,"last_synced_commit":"36d4546e9e8aeb935e226f221a6e8504778b34bc"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaphaelJenni%2FFirebaseUI-Angular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaphaelJenni%2FFirebaseUI-Angular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaphaelJenni%2FFirebaseUI-Angular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaphaelJenni%2FFirebaseUI-Angular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaphaelJenni","download_url":"https://codeload.github.com/RaphaelJenni/FirebaseUI-Angular/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259383,"owners_count":22040820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angularfire2","firebase","firebase-auth","firebaseui"],"created_at":"2024-12-01T05:11:50.252Z","updated_at":"2025-05-15T02:06:54.148Z","avatar_url":"https://github.com/RaphaelJenni.png","language":"TypeScript","readme":"[![Build Status](https://github.com/RaphaelJenni/FirebaseUI-Angular/actions/workflows/firebaseui-angular.yml/badge.svg)](https://github.com/RaphaelJenni/FirebaseUI-Angular/actions/workflows/firebaseui-angular.yml/badge.svg)\n[![npm version](https://badge.fury.io/js/firebaseui-angular.svg)](https://badge.fury.io/js/firebaseui-angular)\n\n# FirebaseUi-Angular\n\n![Screenshot of Login screen](https://raw.githubusercontent.com/RaphaelJenni/FirebaseUI-Angular/master/assets/LoginScreen.PNG)\n\n## Compatibility\n\n| Angular | Firebase | AngularFire | FirebaseUI | FirebaseUI-Angular | Note                                                                                        |\n|---------|---------|-------------|------------|--------------------|---------------------------------------------------------------------------------------------|\n| 18.2.12 | ^11.0.2 | ^18.0.1     | ^6.1.0     | 6.3.0              |                                                                                             |\n| 17.1.0  | ^10.7.2 | ^17.0.1     | ^6.1.0     | 6.2.0              | Dropping old Angular and Firbase versions                                                   |\n| 17.0.0  | ^9.23.0 | ^7.6.1      | ^6.1.0     | 6.1.5              |                                                                                             |\n| 16.0.0  | ^9.23.0 | ^7.6.1      | ^6.1.0     | 6.1.4              |                                                                                             |\n| 15.0.0  | ^9.14.0 | ^7.5.0      | ^6.0.2     | 6.1.3              |                                                                                             |\n| 14.0.2  | ^9.8.3  | ^7.4.1      | ^6.0.1     | 6.1.2              |                                                                                             |\n| 13.0.0  | ^9.3.0  | ^7.1.1      | ^6.0.0     | 6.1.0              |                                                                                             |\n| 12.1.0  | ^9.0.2  | ^7.0.4      | ^6.0.0     | 6.0.0              |                                                                                             |\n| 12.1.0  | ^8.6.8  | ^6.1.5      | ^4.8.0     | 5.1.3              |                                                                                             |\n| 11.0.2  | ^8.2.4  | ^6.1.1      | ^4.7.2     | 5.1.2              | *support for [auth emulator](https://firebase.google.com/docs/emulator-suite/connect_auth)* |\n| 11.0.2  | ^8.1.1  | ^6.1.1      | ^4.7.1     | 5.1.1              |                                                                                             |\n| 10.2.2  | ^8.0.1  | ^6.0.4      | ^4.7.1     | 5.1.0              |                                                                                             |\n| ~8.2.13 | ^7.23.0 | ~5.2.1      | ~4.7.1     | ~4.0.1             |                                                                                             |\n\n\u003csub\u003eVersion combinations not documented here __may__ work but are untested.\u003c/sub\u003e\n\n## Installation\n\nTo install this library, run:\n\n```bash\n$ npm install firebaseui-angular --save\n```\n\nTo run this library you need to have [AngularFire2](https://github.com/angular/angularfire2)\n, [Firebase](https://firebase.google.com/docs/web/setup),\n[FirebaseUI-Web](https://github.com/firebase/firebaseui-web) installed.\nFast install:\n\n```bash\n$ npm install firebase firebaseui @angular/fire firebaseui-angular --save\n```\n\n## How to use\n\nAdd the `FirebaseUIModule` with the config to your imports. Make sure you have\ninitialized [AngularFire](https://github.com/angular/angularfire2) correctly.\n\n```typescript\nimport {BrowserModule} from '@angular/platform-browser';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {AppComponent} from './app.component';\nimport {firebase, firebaseui, FirebaseUIModule} from 'firebaseui-angular';\nimport {environment} from '../environments/environment';\nimport {AppRoutingModule} from './app-routing.module';\nimport {AngularFireModule} from \"@angular/fire/compat\";\nimport {AngularFireAuthModule, USE_EMULATOR as USE_AUTH_EMULATOR} from \"@angular/fire/compat/auth\";\n\n\nconst firebaseUiAuthConfig: firebaseui.auth.Config = {\n  signInFlow: 'popup',\n  signInOptions: [\n    firebase.auth.GoogleAuthProvider.PROVIDER_ID,\n    {\n      scopes: [\n        'public_profile',\n        'email',\n        'user_likes',\n        'user_friends'\n      ],\n      customParameters: {\n        'auth_type': 'reauthenticate'\n      },\n      provider: firebase.auth.FacebookAuthProvider.PROVIDER_ID\n    },\n    firebase.auth.TwitterAuthProvider.PROVIDER_ID,\n    firebase.auth.GithubAuthProvider.PROVIDER_ID,\n    {\n      requireDisplayName: false,\n      provider: firebase.auth.EmailAuthProvider.PROVIDER_ID\n    },\n    firebase.auth.PhoneAuthProvider.PROVIDER_ID,\n    firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID\n  ],\n  tosUrl: '\u003cyour-tos-link\u003e',\n  privacyPolicyUrl: '\u003cyour-privacyPolicyUrl-link\u003e',\n  credentialHelper: firebaseui.auth.CredentialHelper.GOOGLE_YOLO\n};\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    FormsModule,\n    AppRoutingModule,\n    AngularFireModule.initializeApp(environment.firebaseConfig),\n    AngularFireAuthModule,\n    FirebaseUIModule.forRoot(firebaseUiAuthConfig)\n  ],\n  providers: [\n    {provide: USE_AUTH_EMULATOR, useValue: !environment.production ? ['localhost', 9099] : undefined},\n  ],\n  bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n\n\n\n\n```\n\n### Add the firebaseui css to your imports:\n\n**Option 1: CSS Import**\n\n*May be incompatible with older browsers.*\n\nImport the firebaseui css to your `src/styles.css` file:\n\n```css\n@import '~firebaseui/dist/firebaseui.css';\n```\n\n**Option 2: Angular-CLI**\n\nFile: `angular.json`\n\nPath: `\"node_modules/firebaseui/dist/firebaseui.css\"`\n\n```json\n{\n  \"projects\": {\n[\n  your-project-name\n]: {\n...\n\"architect\": {\n\"build\": {\n\"options\": {\n...\n\"styles\": [\n\"src/styles.css\",\n\"node_modules/firebaseui/dist/firebaseui.css\"\n]\n}\n},\n...\n\"test\": {\n\"options\": {\n...\n\"styles\": [\n\"src/styles.css\",\n\"node_modules/firebaseui/dist/firebaseui.css\"\n]\n}\n}\n}\n}\n}\n}\n```\n\n**Option 3: HTML Link**\n\nPut this in the `\u003chead\u003e` tag of your `index.html` file:\n\n```html\n\n\u003clink type=\"text/css\" rel=\"stylesheet\" href=\"https://cdn.firebase.com/libs/firebaseui/3.0.0/firebaseui.css\"/\u003e\n```\n\nMake sure the version number matches the version of firebaseui you have installed with npm.\n\nOnce everything is set up, you can use the component in your Angular application:\n\n```angular2html\n\n\u003cfirebase-ui\u003e\u003c/firebase-ui\u003e\n```\n\n### Configuration\n\nFor the configuration of the module see the official firebaseui\ndocumentation: [Config](https://github.com/firebase/firebaseui-web#configuration)\n\n_If you use a version prior to 3.3.0 check\nthe [old README](https://github.com/RaphaelJenni/FirebaseUI-Angular/blob/v3.2.0/README.MD)_\n\n#### forRoot/forFeature\n\nTo configure the plugin the first time (`main.module.ts`) the `forRoot()` method is used.\nIt builds the basis for all further uses of the plugin.\nBut you have the possibility to overwrite the entire or just parts of the configuration in any (sub-)module.\n\n##### forRoot\n\nTo overwrite the entire configuration use:\n\n```\nFirebaseUIModule.forRoot(firebaseUiAuthConfig: NativeFirebaseUIAuthConfig)\n```\n\n##### forFeature\n\nTo overwrite just parts of the configuration use:\n\n```\nFirebaseUIModule.forFeature(firebaseUiAuthConfig: NativeFirebaseUIAuthConfig)\n```\n\nThis will use the in `forRoot` provided configuration and overwrite just the newly provided values.\n\n##### Using a Provider Factory\n\nYou may need to dynamically create the firebaseui configuration object based on application settings or the like. An\nexample of this might be to conditionally enable certain providers for different deployments of the application.\n\nTo do this you can use a provider factory to inject the  `firebaseUIAuthConfig` in your module like so:\n\n```typescript\nproviders: [\n  {\n    provide: 'appConfig',\n    useValue: {googleAuthEnabled: true, emailAuthEnabled: false}\n  },\n  {\n    provide: 'firebaseUIAuthConfig',\n    useFactory: (config) =\u003e {\n\n      // build firebase UI config object using settings from `config`\n\n      const fbUiConfig: firebaseui.auth.Config = {\n        signInFlow: 'redirect',\n        signInOptions: [],\n        tosUrl: null,\n        privacyPolicyUrl: null,\n        credentialHelper: firebaseui.auth.CredentialHelper.GOOGLE_YOLO\n      };\n\n      if (config.googleAuthEnabled) {\n        fbUiConfig.signInOptions.push(firebase.auth.GoogleAuthProvider.PROVIDER_ID);\n      }\n\n      if (config.emailAuthEnabled) {\n        fbUiConfig.signInOptions.push({\n          provider: firebase.auth.EmailAuthProvider.PROVIDER_ID,\n          requireDisplayName: true,\n          signInMethod: firebase.auth.EmailAuthProvider.EMAIL_PASSWORD_SIGN_IN_METHOD\n        });\n      }\n\n      // other providers as needed\n\n      return fbUiConfig;\n    },\n    deps: ['appConfig']\n  }\n]\n```\n\nIn this case we are injecting a settings object `appConfig` into the provider factory. This object contains flags, such\nas `googleAuthEnabled` and `emailAuthEnabled` which are used to conditionally build the firebaseui config object. You\nwould likely use a provider factory for this that reads settings from the environment or database.\n\n### Listen to auth state changes\n\n```typescript\nthis.angularFireAuth.authState.subscribe(this.firebaseAuthChangeListener);\n\nprivate\nfirebaseAuthChangeListener(response)\n{\n  // if needed, do a redirect in here\n  if (response) {\n    console.log('Logged in :)');\n  } else {\n    console.log('Logged out :(');\n  }\n}\n```\n\nDon't forget to unsubscribe at the end.\n\n### Sign-in success / failure callbacks\n\n```html\n\n\u003cfirebase-ui\n  (signInSuccessWithAuthResult)=\"successCallback($event)\"\n  (signInFailure)=\"errorCallback($event)\"\n  (uiShown)=\"uiShownCallback()\"\u003e\u003c/firebase-ui\u003e\n```\n\n```typescript\nsuccessCallback(signInSuccessData\n:\nFirebaseUISignInSuccessWithAuthResult\n)\n{\n...\n}\n\nerrorCallback(errorData\n:\nFirebaseUISignInFailure\n)\n{\n...\n}\n\nuiShownCallback()\n{\n...\n}\n```\n\n### Disable auto sign-in\n\n```typescript\nconstructor(private\nfirebaseuiAngularLibraryService: FirebaseuiAngularLibraryService\n)\n{\n  firebaseuiAngularLibraryService.firebaseUiInstance.disableAutoSignIn();\n}\n```\n\n## Internationalizaion (i18n)\n\nThe internationalization with just the npm package of the official firebase-ui isn't possible at the moment.\n\nFor a custom version with i18n support\nuse: [l0ll098/FirebaseUI-Angular-i18n](https://github.com/l0ll098/FirebaseUI-Angular-i18n)\n\nThanks to [@l0ll098](https://github.com/l0ll098)!\n\n## Contributing / Sample Application\n\nStep 1: Fork and clone the repo from Github.\n\nStep 2: There is a sample project in the root folder. Execute the following command in the root folder i.e.\n.../FirebaseUI-Angular \u003e `npm install`\n\nStep 3: Ensure that you are using Angular CLI version \u003e10. You can check your version with `ng --version` in the\nterminal.\n\nStep 4: Replace with your firebase config in `src\\environments\\environment.ts`.\n\nStep 5: .../FirebaseUI-Angular \u003e `npm run build-lib`\n\nStep 6: .../FirebaseUI-Angular \u003e `ng serve`\n\nYou're welcome to fork the repo and contribute to library sources\nin `projects` \u003e `firebaseui-angular-library` \u003e `src` \u003e `lib`.\n\nThere are test files, but they are empty at the moment. Writing unit test is a good start.\n\n## Troubleshoot\n\n### UI not rendered\n\nThe 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.\n\n### Prod build error\n\n```\nERROR in ./src/app/app.module.ngfactory.js\nModule not found: Error: Can't resolve 'firebase/index' in '...'\nERROR in ./src/app/app.module.ngfactory.js\nModule not found: Error: Can't resolve 'firebaseui/dist/index' in '...'\n```\n\nUse the firebase and firebaseui instances exposed by the plugin:\n\n`import {..., firebase, firebaseui} from 'firebaseui-angular';`\n\n### CSS not loaded\n\nIf you have added the css to the angular.json but nothing happened. Try to restart the server (`Ctrl-C` and `ng serve`)\n\n### ERROR in ./~/firebase/app/shared_promise.js\n\nThis is a know issue in the firebase project. To fix that (for now), do that:\n\n`npm install promise-polyfill --save-exact`\n\n### `http://localhost:4200/images/buffer.svg?embed` 404 (Not Found)\n\nPut this into your styles.scss file:\n\n```\n@supports (-webkit-appearance:none) {\n  .mdl-progress:not(.mdl-progress--indeterminate):not(.mdl-progress--indeterminate) \u003e .auxbar,\n  .mdl-progress:not(.mdl-progress__indeterminate):not(.mdl-progress__indeterminate) \u003e .auxbar {\n    mask: url(/assets/images/buffer.svg?embed) !important;\n  }\n}\n```\n\nand put a `buffer.svg` file into `assets/images`.\nThis will stop this error message.\n\n## Supporting the Project\n\nIf you like the project and want to support me, I have a\n\u003ca href=\"https://www.wowthemes.net/donate/\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\npage.\n\n## License\n\nMIT © [Raphael Jenni](mailto:info@rjenni.ch)\n","funding_links":["https://www.buymeacoffee.com/raphaeljenni"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaeljenni%2Ffirebaseui-angular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaeljenni%2Ffirebaseui-angular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaeljenni%2Ffirebaseui-angular/lists"}