Home

Awesome

<p align="center"> <img height="256px" width="256px" style="text-align: center;" src="https://raw.githubusercontent.com/firebaseui/ng-bootstrap/HEAD/assets/logo.png"> </p>

@firebaseui/ng-bootstrap - Angular Bootstrap UI library for firebase authentication powered by @ng-bootstrap

npm version npm demo Join the chat at https://gitter.im/firebaseui/Lobby CircleCI branch Build Status Coverage Status dependency Status devDependency Status Greenkeeper Badge license

firebaseui/ng-bootstrap - sign in, sign up demo image firebaseui/ng-bootstrap - reset password demo image

Built by and for developers :heart:

Do you have any question or suggestion ? Please do not hesitate to contact us! Alternatively, provide a PR | open an appropriate issue here

If did you like this project, support @firebaseui/ng-bootstrap by starring :star: and sharing it :loudspeaker:

If you prefer to develop with material design rather than with bootstrap, please check this project ngx-auth-firebaseui

Table of Contents

<a name="vs"/>

ngx-auth-firebaseui vs firebaseui-web

Features@firebaseui/ng-bootstrapngx-auth-firebaseuifirebaseui
Sign Up:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Sign In:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Sign In Anonymously:heavy_check_mark::heavy_check_mark::x:
Sign In with Google:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Sign In with Facebook:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Sign In with Twitter:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Sign In with Github:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Sign In with PhoneNumber:soon::x::heavy_check_mark:
Sign out:heavy_check_mark::heavy_check_mark::x:
Sign in/up progress indicator:heavy_check_mark::heavy_check_mark::x:
Password Strength indicator:soon::heavy_check_mark::x:
Forgot/Reset Password:heavy_check_mark::heavy_check_mark::x:
Delete account:soon::heavy_check_mark::x:
User Profile:soon::heavy_check_mark::x:
Check whether user's email is verified:soon::heavy_check_mark::x:
Edit user's display name (incl. validation):soon::heavy_check_mark::x:
Edit user's email (incl. validation):soon::heavy_check_mark::x:
Edit user's phone number (incl. validation):soon::heavy_check_mark::x:
Configure your favorite auth provider in runtime:heavy_check_mark::heavy_check_mark::x:
Sync user'auth with Firestore read more:heavy_check_mark::heavy_check_mark::x:
Angular v2-6 friendly:heavy_check_mark::heavy_check_mark::x:
Internationalization (i18n):soon: @angular v7:soon: @angular v7:heavy_check_mark:
Ionic/cordova support:soon: @firebaseui/ionic-auth:soon: @firebaseui/ionic-auth:x:
Real time form validation:heavy_check_mark::heavy_check_mark::x:
Easy to integrate:heavy_check_mark::heavy_check_mark::x:
Support Server Side Rendering:heavy_check_mark::heavy_check_mark::x:
Support SPA without further config:heavy_check_mark::heavy_check_mark::x:
Support Safari private browsing:heavy_check_mark::heavy_check_mark::x:
AWESOME:soon::heavy_check_mark::interrobang:
<a name="@firebaseui/ng-bootstrap"/>

Why to use @firebaseui/ng-boostrap ?

<a name="components"/>

Library's components

<a name="supported-providers"/>

Supported Providers:

<a name="supported-procress-and-actions"/>

Supported Processes and Actions:

<a name="demo"/>

Demo

if(issues || feedback || you_need_more_features){
    // send me an email -> to: anthony.na@hotmail.de
}

Dependencies

<a name="requirements"/>

Requirements:

npm install --save @ng-bootstrap/ng-bootstrap bootstrap @angular/fire firebase font-awesome @angular/forms @angular/animations

Installation

Install above dependencies via npm.

Now install @firebaseui/ng-bootstrap via:

npm install --save @firebaseui/ng-bootstrap

SystemJS

Note:If you are using SystemJS, you should adjust your configuration to point to the UMD bundle. In your systemjs config file, map needs to tell the System loader where to look for @firebaseui/ng-bootstrap:

map: {
  '@firebaseui/ng-bootstrap': 'node_modules/@firebaseui/ng-bootstrap/bundles/@firebaseui/ng-bootstrap.umd.js',
}

Once installed you need to import the main module:

import { NgbAuthFirebaseUIModule } from '@firebaseui/ng-bootstrap';

The only remaining part is to list the imported module in your application module. The exact method will be slightly different for the root (top-level) module for which you should end up with the code similar to (notice NgbAuthFirebaseUIModule.forRoot()):

import { NgbAuthFirebaseUIModule } from '@firebaseui/ng-bootstrap';

@NgModule({
  declarations: [AppComponent, ...],
  imports: [NgbAuthFirebaseUIModule.forRoot({
                                             apiKey: 'your-firebase-apiKey',
                                             authDomain: 'your-firebase-authDomain',
                                             databaseURL: 'your-firebase-databaseURL',
                                             projectId: 'your-firebase-projectId',
                                             storageBucket: 'your-firebase-storageBucket',
                                             messagingSenderId: 'your-firebase-messagingSenderId'
                                              }), ...],  
  bootstrap: [AppComponent]
})
export class AppModule {
}

Other modules in your application can simply import NgbAuthFirebaseUIModule:

import { NgbAuthFirebaseUIModule } from '@firebaseui/ng-bootstrap';

@NgModule({
  declarations: [OtherComponent, ...],
  imports: [NgbAuthFirebaseUIModule, ...], 
})
export class OtherModule {
}
<a name="usage"/>

Usage

<ngb-auth-firebaseui></ngb-auth-firebaseui>

<!-- You can now use the library component in app.component.html  -->

<ngb-auth-firebaseui (onSuccess)="printUser($event)"
                     (onError)="printError()">
</ngb-auth-firebaseui>

or

<!-- or simply in the app.component.ts -->
@Component({
    selector: 'app',
    template: `
        <ngb-auth-firebaseui (onSuccess)="printUser($event)" (onError)="printError()"></ngb-auth-firebaseui>`
})
class AppComponent {

    printUser(event) {
        console.log(event);
    }

    printError(event) {
        console.error(event);
    }
}

<ngb-auth-firebaseui-providers></ngb-auth-firebaseui-providers>

<!-- You can now use the library component in app.component.html  -->
<ngb-auth-firebaseui-providers layout="column"></ngb-auth-firebaseui-providers>
<a name="api"/>

API

<ngb-auth-firebaseui></ngb-auth-firebaseui>

optionbindtypedefaultdescription
guestEnabledInput()booleantruewhether the user can sign in and continue as guest
providersInput()string[]['all'] or [AuthProvider.All]choose your favorite authentication provider: google
onSuccessOutput()any-this will be fired when an authentication process was success. The authenticated user is emitted!
onErrorOutput()any-this event will be fired when an error occurred during the authentication process! An error message is emitted!

How to disable users to sign in and continue as guest, use the guestEnabled input

<ngb-auth-firebaseui [guestEnabled]="false"
                     (onSuccess)="printUser($event)"
                     (onError)="printError($event)">
</ngb-auth-firebaseui>

How to configure your input providers ? see the examples

e.g: in your component, import the AuthProvider enum to pick up your favorite provider:

import {OnInit} from '@angular/core';
import {AuthProvider} from '@firebaseui/ng-bootstrap';

export class ExampleComponent implements OnInit {

  providers = AuthProvider;

  ngOnInit() {
  }
}

in your template -->

  <ngb-auth-firebaseui
  [providers]="[providers.Google, providers.Facebook, providers.Twitter]"
  (onSuccess)="printUser($event)"
   (onError)="printError()"></ngb-auth-firebaseui>

or

  <ngb-auth-firebaseui
  [providers]="['google', 'facebook', 'twitter']"
  (onSuccess)="printUser($event)"
  (onError)="printError()">
</ngb-auth-firebaseui>
<a name="run-demo-app-locally"/>

Run Demo App Locally

$ git clone https://github.com/firebaseui/ng-bootstrap.git
$ gulp link
$ cd demo
$ npm i
$ npm run start

or

$ ng serve --open

<a name="development"/>

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

<a name="other-angular-libraries"/>

Other Angular Libraries


Support

Built by and for developers :heart: we will help you :punch:


jetbrains logo

This project is supported by jetbrains with 1 ALL PRODUCTS PACK OS LICENSE incl. webstorm


<a name="license"/>

License

Copyright (c) 2018 Anthony Nahas. Licensed under the MIT License (MIT)