@wilfridli/nestjs-firebase-admin
v3.0.1
Published
Firebase Admin module for Nest framework
Downloads
4
Readme
Description
Firebase Admin Module for Nest.js Framework
This is a fork of @aginix/nestjs-firebase-admin to support NestJS8 dependencies
Installation
$ yarn add @wilfridli/nestjs-firebase-admin
Import module
import { Module } from '@nestjs/common';
import { FirebaseAdminModule } from '@wilfridli/nestjs-firebase-admin'
import * as admin from 'firebase-admin'
@Module({
imports: [
FirebaseAdminModule.forRootAsync({
useFactory: () => ({
credential: admin.credential.applicationDefault()
})
}),
],
})
export class AppModule {}
Example
Inject Authentication Service
import { Injectable } from '@nestjs/common';
import { FirebaseAuthenticationService } from '@aginix/nestjs-firebase-admin';
@Injectable()
export class AppService {
constructor(private firebaseAuth: FirebaseAuthenticationService) {}
getUsers() {
return this.firebaseAuth.listUsers()
}
}
Compatibility Table
| firebase-admin | NestJS Library |
| ----------------- |----------------|
| 9.xx
| master
|
| 8.xx
| 1.xx
|