# cscmobi-fcm-nestjs

> NestJS npm package starter

Latest version **1.0.3** (published 2025-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install cscmobi-fcm-nestjs
pnpm add cscmobi-fcm-nestjs
yarn add cscmobi-fcm-nestjs
bun add cscmobi-fcm-nestjs
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2025-08-05 |
| First published | 2022-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tuyen Nguyen |
| Maintainers | tuyennv11290 |
| Keywords | nestjs |

## Links

- npm: https://www.npmjs.com/package/cscmobi-fcm-nestjs
- Repository: https://github.com/tuyennv38/fcm-nestjs
- Homepage: https://github.com/tuyennv38/fcm-nestjs#readme
- Issues: https://github.com/tuyennv38/fcm-nestjs
- npm.io page: https://npm.io/package/cscmobi-fcm-nestjs

## Dependencies (4)

- [rxjs](https://npm.io/package/rxjs.md) ^7.3.0
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^13.4.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@google-cloud/storage](https://npm.io/package/@google-cloud/storage.md) ^6.11.0

## Recent versions

- 1.0.3 (latest) — 2025-08-05
- 1.0.2 — 2025-08-05
- 1.0.1 — 2022-09-05
- 1.0.0 — 2022-05-24
- 0.4.0 — 2022-05-24

## README

<h1 align="center"></h1>

<div align="center">
  <a href="http://nestjs.com/" target="_blank">
    <img src="https://nestjs.com/img/logo_text.svg" width="150" alt="Nest Logo" />
  </a>
</div>

<h3 align="center">NestJS FCM push notifications module</h3>

<div align="center">
  <a href="https://nestjs.com" target="_blank">
    <img src="https://img.shields.io/badge/built%20with-NestJs-red.svg" alt="Built with NestJS">
  </a>
</div>

### Installation

```bash
npm install --save cscmobi-fcm-nestjs
```

### FcmModule

To user FcmService you must add the module first. **The `FcmModule` has a `@Global()` attribute so you should only import it once**.

```typescript
import { Module } from '@nestjs/common';
import { FcmModule } from 'cscmobi-fcm-nestjs';
import * as path from 'path';

@Module({
  imports: [
    FcmModule.forRoot({
        serviceAccount: {
            projectId: '----YOUR PROJECTID----',
            clientEmail: '---YOUR CLIENT EMAIL---',
            privateKey: '---YOUR PRIVATEKEY----'
        }
    }),
  ],
  controllers: [],
})
export class AppModule {}
```

### `FcmService` use firebase.spec.json file to send notifications using firebase-admin dependency.

```typescript
@Injectable()
export class SampleService {
  constructor(private readonly fcmService: FcmService) {}

  async sendToDevices() {
    await this.fcmService.sendNotification([
      'device_token_1',
      'device_token_2',
      ]
      payload,
      silent,
    );
  }

  async sendToTopic(topic: string) {
    await this.fcmService.sendToTopic(
      topic,
      payload,
      silent,
    );
  }
}
```

## Change Log

See [Changelog](CHANGELOG.md) for more information.

## Contributing

Contributions welcome! See [Contributing](CONTRIBUTING.md).

## Author

**Tran Quy**

## License

Licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---
_Source: https://npm.io/package/cscmobi-fcm-nestjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
