@sebaseg/br-firebase-crud
v1.3.9
Published
CRUD to get collections, documents by id, create and update data in firestore
Downloads
26
Readme
BR FIREBASE CRUD NestJS Library
Nest Library CRUD to get collections, documents by id, create and update data in firestore.
Instructions
Install
npm i @sebaseg/br-firebase-crud
Use library
Added support for use with GCP secret manager ☺
... STEP 1 . You need to set the required firebase credentials in your .env or secret manager
... STEP 2. import BrFirebaseCrudModule in your module:
If you do not set names in root they will be taken as default:
import { Module } from '@nestjs/common';
import { YourService } from './your-service.service';
import { YourController } from './your-controller.controller';
import { BrFirebaseCrudModule } from '@sebaseg/br-firebase-crud';
@Module({
imports: [BrFirebaseCrudModule.forRoot({})],
controllers: [YourController],
providers: [YourService],
})
export class YourModuleModule {}
If you use secretManager, you need to define the name. The default is ''
import { Module } from '@nestjs/common';
import { YourService } from './your-service.service';
import { YourController } from './your-controller.controller';
import { BrFirebaseCrudModule } from '@sebaseg/br-firebase-crud';
@Module({
imports: [
BrFirebaseCrudModule.forRoot({ secretName: 'MY_SECRET_MANAGER_ENV_NAME' }),
],
controllers: [YourController],
providers: [YourService],
})
export class YourModuleModule {}
If you use .env you can define a name. The default name is FIREBASE_CREDENTIALS
import { Module } from '@nestjs/common';
import { YourService } from './your-service.service';
import { YourController } from './your-controller.controller';
import { BrFirebaseCrudModule } from '@sebaseg/br-firebase-crud';
@Module({
imports: [
BrFirebaseCrudModule.forRoot({
firebaseEnvCredName: 'YOUR_FIREBASE_ENV_NAME',
}),
],
controllers: [YourController],
providers: [YourService],
})
export class YourModuleModule {}