Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Latest commit

 

History

History
61 lines (45 loc) · 1.64 KB

README.md

File metadata and controls

61 lines (45 loc) · 1.64 KB

NPM Version Package License NPM Downloads

Description

Firebase Admin Module for Nest.js Framework

Installation

$ yarn add @aginix/nestjs-firebase-admin

Import module

import { Module } from '@nestjs/common';
import { FirebaseAdminModule } from '@aginix/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

License

MIT © Aginix Technologies Co., Ltd.