{"id":17005389,"url":"https://github.com/andreialecu/node-apn-http2","last_synced_at":"2026-03-04T03:31:08.517Z","repository":{"id":49179259,"uuid":"109011518","full_name":"andreialecu/node-apn-http2","owner":"andreialecu","description":"Communicate with Apple Push Notification Service via native Node.js v8.8.1+ HTTP2 module (node-apn drop-in)","archived":false,"fork":false,"pushed_at":"2021-06-24T20:24:38.000Z","size":45,"stargazers_count":27,"open_issues_count":9,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-19T05:44:20.146Z","etag":null,"topics":["apns","apple","http2","nodejs","push-notifications"],"latest_commit_sha":null,"homepage":null,"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/andreialecu.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-31T14:58:42.000Z","updated_at":"2024-08-23T07:17:55.000Z","dependencies_parsed_at":"2022-08-29T03:43:39.582Z","dependency_job_id":null,"html_url":"https://github.com/andreialecu/node-apn-http2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andreialecu/node-apn-http2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreialecu%2Fnode-apn-http2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreialecu%2Fnode-apn-http2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreialecu%2Fnode-apn-http2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreialecu%2Fnode-apn-http2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreialecu","download_url":"https://codeload.github.com/andreialecu/node-apn-http2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreialecu%2Fnode-apn-http2/sbom","scorecard":{"id":192692,"data":{"date":"2025-08-11","repo":{"name":"github.com/andreialecu/node-apn-http2","commit":"32f65f0f8a1897c9aee0cdd87d04715b2168c3da"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-rvg8-pwq2-xj7q","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T21:07:31.406Z","repository_id":49179259,"created_at":"2025-08-16T21:07:31.407Z","updated_at":"2025-08-16T21:07:31.407Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: 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":["apns","apple","http2","nodejs","push-notifications"],"created_at":"2024-10-14T04:46:14.014Z","updated_at":"2026-03-04T03:31:08.497Z","avatar_url":"https://github.com/andreialecu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-apn-http2\n==============\n\n[![Current Version](https://img.shields.io/npm/v/node-apn-http2.svg?style=flat-square)](https://www.npmjs.org/package/node-apn-http2)\n\n\u003e A Node.js module for interfacing with the Apple Push Notification service using *NATIVE* node.js http2 API (requires node v8.8.1+)\n\nThis package is supposed to be drop-in compatible with [node-apn](https://github.com/node-apn/node-apn), however, only token based credentials are supported (p8).\n\n### Installation\n\n[yarn](https://yarnpkg.com) is the preferred installation method:\n\n```bash\n$ yarn add node-apn-http2\n```\n\n### Load in the module\n\n```javascript\nvar apn = require('node-apn-http2');\n```\n\n```javascript\nvar options = {\n  token: {\n    key: \"path/to/APNsAuthKey_XXXXXXXXXX.p8\",\n    keyId: \"key-id\",\n    teamId: \"developer-team-id\"\n  },\n  production: false,\n  hideExperimentalHttp2Warning: true // the http2 module in node is experimental and will log \n                                     // ExperimentalWarning: The http2 module is an experimental API. \n                                     // to the console unless this is set to true\n};\n\nvar apnProvider = new apn.Provider(options);\n```\n\nBy default, the provider will connect to the sandbox unless the environment variable `NODE_ENV=production` is set.\n\n### Sending a notification\nTo send a notification you will first need a device token from your app as a string\n\n```javascript\nlet deviceToken = \"a9d0ed10e9cfd022a61cb08753f49c5a0b0dfb383697bf9f9d750a1003da19c7\"\n```\n\n```javascript\nvar note = new apn.Notification();\n\nnote.expiry = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now.\nnote.badge = 3;\nnote.sound = \"ping.aiff\";\nnote.alert = \"\\uD83D\\uDCE7 \\u2709 You have a new message\";\nnote.payload = {'messageFrom': 'John Appleseed'};\nnote.topic = \"\u003cyour-app-bundle-id\u003e\";\n```\n\nSend the notification to the API with `send`, which returns a promise.\n\n```javascript\napnProvider.send(note, deviceToken).then( (result) =\u003e {\n  // see documentation for an explanation of result\n});\n```\n\nThis will result in the the following notification payload being sent to the device\n\n```json\n{\"messageFrom\":\"John Appelseed\",\"aps\":{\"badge\":3,\"sound\":\"ping.aiff\",\"alert\":\"\\uD83D\\uDCE7 \\u2709 You have a new message\"}}\n```\n\nYou should only create one `Provider` per-process for each certificate/key pair you have. You do not need to create a new `Provider` for each notification. If you are only sending notifications to one app then there is no need for more than one `Provider`. \n\nIf you are constantly creating `Provider` instances in your app, make sure to call `Provider.shutdown()` when you are done with each provider to release its resources and memory. \n\n## Troubleshooting\n\nYou are encouraged to read the extremely informative [Troubleshooting Push Notifications](http://developer.apple.com/library/ios/#technotes/tn2265/_index.html) Tech Note in the first instance, in case your query is answered there.\n\n## History\n\n### v1.2.0\n\n- return potential error response body as object instead of string (fixes #4) \n\n### v1.1.0\n\n- add option to hide \"ExperimentalWarning: The http2 module is an experimental API.\" message\n\n### v1.0.1\n\n- fix base64 encoded p8 token string not being correctly identified as a string\n\n### v1.0.0\n\n- returned promise from `.send()` is now compatible with the one that `node-apn` normally returned","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreialecu%2Fnode-apn-http2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreialecu%2Fnode-apn-http2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreialecu%2Fnode-apn-http2/lists"}