Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tfarras/nestjs-firebase-admin
NestJS Module for Firebase Admin SDK
https://github.com/tfarras/nestjs-firebase-admin
firebase firebase-admin-sdk nestjs nodejs sdk
Last synced: 19 days ago
JSON representation
NestJS Module for Firebase Admin SDK
- Host: GitHub
- URL: https://github.com/tfarras/nestjs-firebase-admin
- Owner: tfarras
- Created: 2020-04-11T14:41:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-26T09:19:06.000Z (almost 3 years ago)
- Last Synced: 2024-10-17T11:01:53.043Z (29 days ago)
- Topics: firebase, firebase-admin-sdk, nestjs, nodejs, sdk
- Language: TypeScript
- Homepage:
- Size: 9.77 KB
- Stars: 31
- Watchers: 2
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
NestJS Module for Firebase Admin SDK
# Installation
```bash
npm install @tfarras/nestjs-firebase-admin
```## Import module
```typescript
import { Module } from '@nestjs/common';
import { FirebaseAdminModule } from '@tfarras/nestjs-firebase-admin'
import * as admin from 'firebase-admin'
@Module({
imports: [
FirebaseAdminModule.forRootAsync({
useFactory: () => ({
credential: admin.credential.applicationDefault()
})
}),
],
})
export class AppModule {}
```# Example
## Inject FirebaseAdminSDK
```typescript
import { Injectable, Inject } from '@nestjs/common';
import { FIREBASE_ADMIN_INJECT, FirebaseAdminSDK } from '@tfarras/nestjs-firebase-admin';@Injectable()
export class AppService {
constructor(
@Inject(FIREBASE_ADMIN_INJECT) private firebaseAdmin: FirebaseAdminSDK,
) {}getUsers() {
return this.firebaseAdmin.auth().listUsers();
}
}
```