{"id":19227446,"url":"https://github.com/sushantrahate/send-beacon-nodejs","last_synced_at":"2026-05-15T12:04:42.643Z","repository":{"id":248544676,"uuid":"828994285","full_name":"sushantrahate/send-beacon-nodejs","owner":"sushantrahate","description":"It's intended to be used for sending analytics data to a web server when the user navigates away from the page.","archived":false,"fork":false,"pushed_at":"2024-10-19T17:06:11.000Z","size":33,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T10:29:06.275Z","etag":null,"topics":["javascript","nodejs","sendbeacon"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sushantrahate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-15T14:38:56.000Z","updated_at":"2024-07-21T10:54:38.000Z","dependencies_parsed_at":"2025-02-23T10:25:56.113Z","dependency_job_id":"d4f913ac-9c6f-4e08-bf81-2d42304e2f5e","html_url":"https://github.com/sushantrahate/send-beacon-nodejs","commit_stats":null,"previous_names":["sushantrahate/send-beacon-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sushantrahate/send-beacon-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantrahate%2Fsend-beacon-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantrahate%2Fsend-beacon-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantrahate%2Fsend-beacon-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantrahate%2Fsend-beacon-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sushantrahate","download_url":"https://codeload.github.com/sushantrahate/send-beacon-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantrahate%2Fsend-beacon-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272475495,"owners_count":24940718,"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-08-28T02:00:10.768Z","response_time":74,"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":["javascript","nodejs","sendbeacon"],"created_at":"2024-11-09T15:23:19.991Z","updated_at":"2026-05-15T12:04:37.610Z","avatar_url":"https://github.com/sushantrahate.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Navigator: sendBeacon() method Example\n\n[MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon)\n\nThe `navigator.sendBeacon()` method asynchronously sends an HTTP POST request containing a small amount of data to a web server.\n\nIt's intended to be used for sending analytics data to a web server when the user navigates away from the page.\n\n\u003e Avoid using **unload** and **beforeunload** events to send analytics at the end of a session.\n\n## Usage\n\nDownload the repository, install dependencies with `npm install`, and run the server with `node server.js`.\n\n```sh\ngit clone https://github.com/sushantrahate/send-beacon-nodejs.git\ncd send-beacon-nodejs\nnpm install\nnode server.js\n```\n\n## Access the App\n\nOpen a browser and navigate to http://localhost:3000/index.html. When you leave the page, the sendBeacon API gets called.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsushantrahate%2Fsend-beacon-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsushantrahate%2Fsend-beacon-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsushantrahate%2Fsend-beacon-nodejs/lists"}