1.0.1 • Published 4 years ago

@ngx-firebase/client v1.0.1

Weekly downloads
17
License
MIT
Repository
github
Last release
4 years ago

NgxFirebaseClient

The Firebase Client provides a configurable instance of the official Firebase SDK to Angular.

We built this because we prefer to use core SDKs for Firebase over more opinionated packages.

  • All of the Firebase documentation is valid
  • The API is much closer to the NodeJS admin API, making full stack development easier
  • The skills you gain developing are relevant on any platform

Installation

First install the firebase SDK and NgxFirebaseClient modules:

npm i firebase @ngx-firebase/client

Then import the module in your root app module:

// src/app/app.module.ts
...
import {NgxFirebaseClientModule} from '@ngx-firebase/client';
...
imports: [
  BrowserModule,
  NgxFirebaseClientModule.forRoot({
    apiKey: "#####",
    authDomain: "#####",
    databaseURL: "#####",
    projectId: "#####",
    storageBucket: "#####",
    messagingSenderId: "#####",
    appId: "#####",
    measurementId: "#####",
  })
],
...

Now you are ready to use the SDK in your components

// src/app/app.component.ts
import {NgxFirebaseClientService} from '@ngx-firebase/client';
...
export class AppComponent {
  constructor(private firebase: NgxFirebaseClientService) {
    // do something with the SDK
  }
}