@repulsetech/nestjs-firebase-admin
v11.0.0
Published
Firebase Admin v10 module for Nest framework
Downloads
6
Readme
Description
Firebase Admin v10 Module for Nest.js Framework
Installation
$ yarn add @repulsetech/nestjs-firebase-admin
$ npi i @repulsetech/nestjs-firebase-admin -S
Import module
import { Module } from '@nestjs/common';
import { FirebaseAdminModule } from '@repulsetech/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 { Auth } from 'firebase-admin/auth';
@Injectable()
export class AppService {
constructor(private firebaseAuth: Auth) {}
getUsers() {
return this.firebaseAuth.listUsers()
}
}
Compatibility Table
| firebase-admin | NestJS Library |
| ----------------- |----------------|
| 10.xx
| master
|