{"id":18291800,"url":"https://github.com/prantadas/firemsg","last_synced_at":"2026-05-07T09:36:49.090Z","repository":{"id":255080003,"uuid":"811038952","full_name":"PrantaDas/firemsg","owner":"PrantaDas","description":"This is a simple wrapper service for sending notifications built on top of Firebase Cloud Messaging (FCM). It provides a function to send notifications with customizable options.","archived":false,"fork":false,"pushed_at":"2024-08-27T19:57:09.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T13:41:13.056Z","etag":null,"topics":["firebase-admin-sdk","nodejs","npm-package","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/PrantaDas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2024-06-05T20:29:26.000Z","updated_at":"2025-10-03T12:35:52.000Z","dependencies_parsed_at":"2024-08-27T22:40:59.883Z","dependency_job_id":"f23cf0f5-9e16-4387-a9bc-2ce34e717e56","html_url":"https://github.com/PrantaDas/firemsg","commit_stats":null,"previous_names":["prantadas/firemsg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PrantaDas/firemsg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Ffiremsg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Ffiremsg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Ffiremsg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Ffiremsg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrantaDas","download_url":"https://codeload.github.com/PrantaDas/firemsg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Ffiremsg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32731913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-admin-sdk","nodejs","npm-package","typescript"],"created_at":"2024-11-05T14:15:16.107Z","updated_at":"2026-05-07T09:36:49.070Z","avatar_url":"https://github.com/PrantaDas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FIRE MSG\n\n## Overview\nThis is a simple wrapper service for sending notifications built on top of Firebase Cloud Messaging (FCM). It provides a function to send notifications with customizable options.\n\n# Installation \nYou can install **firemsg** using `npm`, `yarn`, `pnpm`.\n\n## npm\n```sh\n\u003cnot published yet\u003e\n```\n\n## pnpm\n```sh\n\u003cnot published yet\u003e\n```\n\n## yarn\n```sh\n\u003cnot published yet\u003e\n```\n\n# Example \n## TypeScript\nFirst, import the package and initialize the `firemsg` with the path to your Firebase Admin SDK JSON file:\n```ts\nimport { FCM, NotificationOptions } from 'firemsg';\n\n// optional, if the credentials file is present in the root driectory of the application\nconst credentialPath =\"path/to/credentials/json\"\n\n// Initialize FCM service with Firebase Admin SDK JSON file path\nconst fcm = FCM(credentialPath);\n\n// Define notification options\nconst options: NotificationOptions = {\n    title: 'New Message',\n    body: 'You have received a new message',\n    topic: 'news',\n    imageUrl: 'https://example.com/image.png',\n    sound: 'default',\n};\n\n// Send a notification\ntry {\n    // optional, if the credentials file is present in the root driectory of the application\n    const credentialPath =\"path/to/credentials/json\"\n    const fcm = FCM(\"app_name\", credentialPath);\n    const messageId = await fcm.send(options);\n    console.log('Notification sent. Message ID:', messageId);\n} catch (error) {\n    console.error('Failed to send notification:', error);\n}\n```\n## CommonJS\nFirst, require the package and initialize the Firebase Cloud Messaging service with the path to your Firebase Admin SDK JSON file:\n\n```js\nconst { FCM } = require('firemsg');\n\n\n// optional, if the credentials file is present in the root driectory of the application\nconst credentialPath =\"path/to/credentials/json\"\n// Initialize FCM service with Firebase Admin SDK JSON file path\nconst fcm = FCM(\"app_name\", credentialPath);\n\n// Define notification options\nconst options = {\n    title: 'New Message',\n    body: 'You have received a new message',\n    topic: 'news',\n    imageUrl: 'https://example.com/image.png',\n    sound: 'default',\n};\n\n// Send a notification\nfcm.send(options)\n    .then((messageId) =\u003e {\n        console.log('Notification sent. Message ID:', messageId);\n    })\n    .catch((error) =\u003e {\n        console.error('Failed to send notification:', error);\n    });\n```\n\n# API\n`FCM(name: string, credentialPath?: string): { send: (options: NotificationOptions) =\u003e Promise\u003cstring\u003e }`\n\nInitializes the  Firebase Cloud Messaging service  service with the provided Firebase Admin SDK JSON file path. Returns an object with a `send` method.\n\n### Parameters\n\n* `name` (string) : The name of the service\n\n* `credentialPath` (string,optional): The path to the Firebase Admin SDK JSON file.\n\n`send(options: NotificationOptions): Promise\u003cstring\u003e`\n\nSends a notification using Firebase Cloud Messaging with the provided options.\n\n### Parameters\n\n* options (NotificationOptions): The notification options.\n\n    * `title` (string): The title of the notification.\n    * `body` (string): The body of the notification.\n    * `topic` (string): The topic to which the notification will be sent.\n    * `imageUrl` (string, optional): The URL of the image to be included in the notification.\n    * `sound` (string, optional): The sound to be played when the notification is received.\n    * `data` (`Data`,optional): The addtional data to be sent with the notification.\n\n### Returns\n* `Promise\u003cstring\u003e`: The message ID of the sent notification.\n\n# Note\nThis package is created as part of a learning process. Feedback and contributions are welcome! Feel free to open issues or pull requests on [GitHub](https://github.com/PrantaDas/firemsg).\n\nLicense\nThis project is licensed under the [MIT License](https://github.com/PrantaDas/firemsg/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantadas%2Ffiremsg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantadas%2Ffiremsg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantadas%2Ffiremsg/lists"}