{"id":25271654,"url":"https://github.com/viniciuscestarii/web-push","last_synced_at":"2026-05-18T06:04:37.099Z","repository":{"id":276975307,"uuid":"930913721","full_name":"ViniciusCestarii/web-push","owner":"ViniciusCestarii","description":"📨 Web push notification example app using the web-push library","archived":false,"fork":false,"pushed_at":"2025-03-07T18:57:25.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T07:18:02.915Z","etag":null,"topics":["fcm-notifications","node","push-notifications","web","web-push"],"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/ViniciusCestarii.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":"2025-02-11T12:23:40.000Z","updated_at":"2025-03-07T18:57:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6e74968-7c65-4cff-986c-17a7f0934138","html_url":"https://github.com/ViniciusCestarii/web-push","commit_stats":null,"previous_names":["viniciuscestarii/web-push"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ViniciusCestarii/web-push","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fweb-push","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fweb-push/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fweb-push/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fweb-push/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ViniciusCestarii","download_url":"https://codeload.github.com/ViniciusCestarii/web-push/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fweb-push/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274756531,"owners_count":25343559,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fcm-notifications","node","push-notifications","web","web-push"],"created_at":"2025-02-12T12:35:01.409Z","updated_at":"2026-05-18T06:04:32.047Z","avatar_url":"https://github.com/ViniciusCestarii.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web-push\n\nThis is a simple web push notification example using the [web-push](https://www.npmjs.com/package/web-push) library.\n\n\n\u003cdiv align=\"center\"\u003e\n  \n![image](https://github.com/user-attachments/assets/4ee20172-8950-47d8-b07c-c13f9dd48e2a)\n\n\u003c/div\u003e\n\n## Requirements\n\n- Node.js\n- npm\n\n## Installation\n\n1. Clone the repository\n   ```bash\n   git clone https://github.com/ViniciusCestarii/web-push.git\n   ```\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n## Setup\n\n1. Create environment file:\n   ```bash\n   cp .env.example .env\n   ```\n2. Generate VAPID keys:\n   ```bash\n   npm run generate-vapid-keys\n   ```\n3. Update the `.env` file with the generated VAPID keys:\n   ```bash\n   VAPID_PUBLIC_KEY=\u003cyour-public-key\u003e\n   VAPID_PRIVATE_KEY=\u003cyour-private-key\u003e\n   ```\n4. Update `index.html` with the public key:\n   ```js\n   applicationServerKey: 'Your VAPID public key here'\n   ```\n\n## Usage\n\n\n### Start the frontend server to subscribe to push notifications\n\n1. Start a local server to serve the frontend:\n   - Using VS Code: Install \"Live Server\" extension and right-click `index.html` to open with Live Server\n   - Or use any HTTP server of your choice\n\n2. Open the webpage in your browser\n   - Allow push notifications when prompted\n   - Check browser console for subscription object\n   - Copy subscription details to your .env file\n   ```bash\n   USER_ENDPOINT=\u003cendpoint-from-console\u003e\n   USER_AUTH=\u003cauth-from-console\u003e\n   USER_P256DH=\u003cp256dh-from-console\u003e\n   ```\n\n\u003e In a real-world scenario, you would save the subscription object in a database.\n\n3. Send a push notification\n\n\u003e Certify that all the .env variables are set.\n\n```bash\nnpm run send\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Support\n\n[Browser Push compatibility](https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility)\n\n[Browser VAPID support](https://github.com/web-push-libs/web-push?tab=readme-ov-file#browser-support)\n\n## Production Notes\n\nIn a production environment:\n\n- Store subscription objects in a database\n- Implement proper error handling\n- Use secure HTTPS connections\n- Consider implementing subscription management\n- Implement retry mechanisms in case of failures or transient issues with the push service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciuscestarii%2Fweb-push","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciuscestarii%2Fweb-push","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciuscestarii%2Fweb-push/lists"}