{"id":16036486,"url":"https://github.com/tranphuquy19/fcm-nestjs","last_synced_at":"2025-03-18T04:30:24.657Z","repository":{"id":57109331,"uuid":"386437256","full_name":"tranphuquy19/fcm-nestjs","owner":"tranphuquy19","description":"Firebase Cloud Message module for NestJS","archived":false,"fork":false,"pushed_at":"2023-02-21T07:32:47.000Z","size":351,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T06:55:15.766Z","etag":null,"topics":["firebase","nest","nestjs","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tranphuquy19.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-15T22:13:32.000Z","updated_at":"2024-06-13T07:16:51.000Z","dependencies_parsed_at":"2024-10-27T17:17:59.464Z","dependency_job_id":null,"html_url":"https://github.com/tranphuquy19/fcm-nestjs","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.25,"last_synced_commit":"8727042c29cc562da04194fa87cfb38e2ab3f439"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2Ffcm-nestjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2Ffcm-nestjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2Ffcm-nestjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranphuquy19%2Ffcm-nestjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tranphuquy19","download_url":"https://codeload.github.com/tranphuquy19/fcm-nestjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902241,"owners_count":20366258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","nest","nestjs","nodejs","typescript"],"created_at":"2024-10-08T22:04:58.240Z","updated_at":"2025-03-18T04:30:24.259Z","avatar_url":"https://github.com/tranphuquy19.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"150\" alt=\"Nest Logo\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch3 align=\"center\"\u003eNestJS FCM push notifications module\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://nestjs.com\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/built%20with-NestJs-red.svg\" alt=\"Built with NestJS\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n_This project forked from [CostianuRazvan/nestjs-fcm](https://github.com/CostianuRazvan/nestjs-fcm)_\n\n### Installation\n\n```bash\nnpm install --save @doracoder/fcm-nestjs\n```\n\n### FcmModule\n\nTo user FcmService you must add the module first. **The `FcmModule` has a `@Global()` attribute so you should only import it once**.\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { FcmModule } from '@doracoder/fcm-nestjs';\nimport * as path from 'path';\n\n@Module({\n  imports: [\n    FcmModule.forRoot({\n      firebaseSpecsPath: path.join(__dirname, '../firebase.spec.json'),\n    }),\n  ],\n  controllers: [],\n})\nexport class AppModule {}\n```\n\n### `FcmService` use firebase.spec.json file to send notifications using firebase-admin dependency.\n\n```typescript\n@Injectable()\nexport class SampleService {\n  constructor(private readonly fcmService: FcmService) {}\n\n  async sendToDevices() {\n    await this.fcmService.sendNotification([\n      'device_token_1',\n      'device_token_2',\n      ]\n      payload,\n      silent,\n    );\n  }\n\n  async sendToTopic(topic: string) {\n    await this.fcmService.sendToTopic(\n      topic,\n      payload,\n      silent,\n    );\n  }\n}\n```\n\n## Change Log\n\nSee [Changelog](CHANGELOG.md) for more information.\n\n## Contributing\n\nContributions welcome! See [Contributing](CONTRIBUTING.md).\n\n## Author\n\n**Tran Quy**\n\n## License\n\nLicensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranphuquy19%2Ffcm-nestjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftranphuquy19%2Ffcm-nestjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranphuquy19%2Ffcm-nestjs/lists"}