{"id":17910496,"url":"https://github.com/matthieulemoine/electron-push-receiver","last_synced_at":"2025-10-07T16:39:21.528Z","repository":{"id":26335403,"uuid":"108295698","full_name":"MatthieuLemoine/electron-push-receiver","owner":"MatthieuLemoine","description":"A module to bring Web Push support to Electron allowing it to receive notifications from Firebase Cloud Messaging (FCM).","archived":false,"fork":false,"pushed_at":"2022-12-07T09:36:31.000Z","size":152,"stargazers_count":195,"open_issues_count":56,"forks_count":71,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T20:09:02.857Z","etag":null,"topics":["electron","fcm","firebase-cloud-messaging","notifications","push-notifications","push-receiver","webpush"],"latest_commit_sha":null,"homepage":"https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0","language":"JavaScript","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/MatthieuLemoine.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}},"created_at":"2017-10-25T16:24:56.000Z","updated_at":"2024-12-26T11:26:54.000Z","dependencies_parsed_at":"2023-01-14T04:26:48.669Z","dependency_job_id":null,"html_url":"https://github.com/MatthieuLemoine/electron-push-receiver","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthieuLemoine%2Felectron-push-receiver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthieuLemoine%2Felectron-push-receiver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthieuLemoine%2Felectron-push-receiver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthieuLemoine%2Felectron-push-receiver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatthieuLemoine","download_url":"https://codeload.github.com/MatthieuLemoine/electron-push-receiver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249527,"owners_count":20908212,"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":["electron","fcm","firebase-cloud-messaging","notifications","push-notifications","push-receiver","webpush"],"created_at":"2024-10-28T19:31:57.657Z","updated_at":"2025-10-07T16:39:11.538Z","avatar_url":"https://github.com/MatthieuLemoine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# electron-push-receiver\n\nA module to bring Web Push support to [Electron](https://github.com/electron/electron) allowing it to receive notifications from Firebase Cloud Messaging (FCM).\n\n## Why and how ?\n\nSee [this blog post](https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0).\n\n## Install\n\n```\nnpm i -S electron-push-receiver\n```\n\n## Usage\n\n- In `main.js` / in main process :\n\n```javascript\nconst { setup: setupPushReceiver } = require('electron-push-receiver');\n\n// Call it before 'did-finish-load' with mainWindow a reference to your window\nsetupPushReceiver(mainWindow.webContents);\n```\n\n- In renderer process :\n\n```javascript\nimport { ipcRenderer } from 'electron';\nimport {\n  START_NOTIFICATION_SERVICE,\n  NOTIFICATION_SERVICE_STARTED,\n  NOTIFICATION_SERVICE_ERROR,\n  NOTIFICATION_RECEIVED as ON_NOTIFICATION_RECEIVED,\n  TOKEN_UPDATED,\n} from 'electron-push-receiver/src/constants';\n\n// Listen for service successfully started\nipcRenderer.on(NOTIFICATION_SERVICE_STARTED, (_, token) =\u003e // do something);\n// Handle notification errors\nipcRenderer.on(NOTIFICATION_SERVICE_ERROR, (_, error) =\u003e // do something);\n// Send FCM token to backend\nipcRenderer.on(TOKEN_UPDATED, (_, token) =\u003e // Send token);\n// Display notification\nipcRenderer.on(ON_NOTIFICATION_RECEIVED, (_, notification) =\u003e // display notification);\n// Start service\nipcRenderer.send(START_NOTIFICATION_SERVICE, senderId);\n```\n\n## Example\n\nThanks to [CydeSwype](https://github.com/CydeSwype), you can find an example project [here](https://github.com/CydeSwype/electron-fcm-demo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthieulemoine%2Felectron-push-receiver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthieulemoine%2Felectron-push-receiver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthieulemoine%2Felectron-push-receiver/lists"}