nest-firebase-module
v0.0.3
Published
Firebase, NestJS,
Downloads
3
Maintainers
Readme
Nest Firebase Module
Installation
This module requires Nestjs to run.
$ npm install --save nest-firebase-module
Examples
you can import firebase module like this
import {FirebaseModule } from 'nest-firebase-module'
imports: [
FirebaseModule.forRootAsync({
useFactory: (config: ConfigService) => ({
credentials: {
privateKey: config.firebasePrivateKey,
projectId: config.firebaseProjectId,
clientEmail: config.firebaseClientEmail,
},
}),
inject: [ConfigService],
}),
]
and in your service file
@Inject('Firestore')
private readonly firestore,
@Inject('Firebase')
private readonly firebase,
If your project is using firestore as its core db. you can inject collection like
FirebaseModule.forFeature('collectionName')
and in your service,
@Inject('collectionName')
private readonly collectionName,
To contribute
This is the base repo, you can contribute to it to expose more functionality of firebase
TODOs
- inject firebase subscriptions in decorators style
- firestore schema validation like mongoose