{"id":50722217,"url":"https://github.com/pushpad/pushpad-node","last_synced_at":"2026-06-10T01:02:42.029Z","repository":{"id":7455111,"uuid":"56427862","full_name":"pushpad/pushpad-node","owner":"pushpad","description":"Node.js library for sending push notifications from websites and web apps.","archived":false,"fork":false,"pushed_at":"2025-10-23T15:12:19.000Z","size":258,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T17:22:04.648Z","etag":null,"topics":["notifications","web-push"],"latest_commit_sha":null,"homepage":"https://pushpad.xyz","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/pushpad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-04-17T09:03:01.000Z","updated_at":"2025-10-01T14:31:57.000Z","dependencies_parsed_at":"2024-01-22T15:33:30.639Z","dependency_job_id":"8d42a4b2-3a16-417d-b3b0-7c8c3409785f","html_url":"https://github.com/pushpad/pushpad-node","commit_stats":{"total_commits":45,"total_committers":1,"mean_commits":45.0,"dds":0.0,"last_synced_commit":"731bfe01d65820284041e716f12c7ae6d7065d34"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pushpad/pushpad-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpad%2Fpushpad-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpad%2Fpushpad-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpad%2Fpushpad-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpad%2Fpushpad-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pushpad","download_url":"https://codeload.github.com/pushpad/pushpad-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushpad%2Fpushpad-node/sbom","scorecard":{"id":750333,"data":{"date":"2025-08-11","repo":{"name":"github.com/pushpad/pushpad-node","commit":"607d05c6888fa7389aefc7f7205ed68e072edcc3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Maintained","score":0,"reason":"1 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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/pushpad/pushpad-node/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pushpad/pushpad-node/ci.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"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":"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.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"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-22T20:08:26.965Z","repository_id":7455111,"created_at":"2025-08-22T20:08:26.965Z","updated_at":"2025-08-22T20:08:26.965Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34132030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":["notifications","web-push"],"created_at":"2026-06-10T01:02:36.266Z","updated_at":"2026-06-10T01:02:37.047Z","avatar_url":"https://github.com/pushpad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pushpad - Web Push Notifications\n\n[![npm version](https://img.shields.io/npm/v/pushpad.svg)](https://www.npmjs.com/package/pushpad)\n![Build Status](https://github.com/pushpad/pushpad-node/workflows/CI/badge.svg)\n\n[Pushpad](https://pushpad.xyz) is a service for sending push notifications from websites and web apps. It uses the **Push API**, which is a standard supported by all major browsers (Chrome, Firefox, Opera, Edge, Safari).\n\nThe notifications are delivered in real time even when the users are not on your website and you can target specific users or send bulk notifications.\n\n## Installation\n\nAdd this package to your project dependencies:\n\n```bash\nnpm install pushpad\n```\n\nOr add it with Yarn:\n\n```bash\nyarn add pushpad\n```\n\n## TL;DR Quickstart\n\n```javascript\nimport Pushpad from \"pushpad\";\n\nconst pushpad = new Pushpad({\n  authToken: \"token\", // from account settings\n  projectId: 123 // from project settings\n});\n\ntry {\n  // send a notification\n  const result = await pushpad.notification.create({\n    body: \"Your message\",\n    // and all the other fields\n  });\n  console.log(result.id);\n} catch (err) {\n  console.log(err);\n}\n\n// you can also pass projectId directly to a function (instead of setting it globally)\nconst result = await pushpad.notification.create({\n  body: \"Your message\"\n}, { projectId: 123 });\n\n// Notifications API\npushpad.notification.create(data, options);\npushpad.notification.findAll(query, options);\npushpad.notification.find(id);\npushpad.notification.cancel(id);\n\n// Subscriptions API\npushpad.subscription.create(data, options);\npushpad.subscription.count(query, options);\npushpad.subscription.findAll(query, options);\npushpad.subscription.find(id, options);\npushpad.subscription.update(id, data, options);\npushpad.subscription.delete(id, options);\n\n// Projects API\npushpad.project.create(data);\npushpad.project.findAll();\npushpad.project.find(id);\npushpad.project.update(id, data);\npushpad.project.delete(id);\n\n// Senders API\npushpad.sender.create(data);\npushpad.sender.findAll();\npushpad.sender.find(id);\npushpad.sender.update(id, data);\npushpad.sender.delete(id);\n```\n\n## Getting started\n\nFirst you need to sign up to Pushpad and create a project there.\n\nThen set your authentication credentials:\n\n```javascript\nimport Pushpad from 'pushpad';\n\nconst pushpad = new Pushpad({\n  authToken: '5374d7dfeffa2eb49965624ba7596a09',\n  projectId: 123 // set it here or pass it as a param to methods later\n});\n```\n\n- `authToken` can be found in the user account settings. \n- `projectId` can be found in the project settings.\n\nIf your application uses multiple projects, you can pass the `projectId` as an option to methods:\n\n```javascript\npushpad.notification.create(data, { projectId: 123 });\n\npushpad.notification.findAll(query, { projectId: 123 });\n\npushpad.subscription.count(query, { projectId: 123 });\n\n// ...\n```\n\n## Collecting user subscriptions to push notifications\n\nYou can subscribe the users to your notifications using the Javascript SDK, as described in the [getting started guide](https://pushpad.xyz/docs/pushpad_pro_getting_started).\n\nIf you need to generate the HMAC signature for the `uid` you can use this helper:\n\n```javascript\npushpad.signatureFor(currentUserId);\n```\n\n## Sending push notifications\n\nUse `pushpad.notification.create()` (or the `send()` alias) to create and send a notification:\n\n```javascript\n// send a simple notification\nawait pushpad.notification.send({ body: 'Your message' });\n\n// a more complex notification with all the optional fields\nconst payload = {\n  // required, the main content of the notification\n  body: 'Hello world!',\n\n  // optional, the title of the notification (defaults to your project name)\n  title: 'Website Name',\n\n  // optional, open this link on notification click (defaults to your project website)\n  target_url: 'https://example.com',\n\n  // optional, the icon of the notification (defaults to the project icon)\n  icon_url: 'https://example.com/assets/icon.png',\n\n  // optional, the small icon displayed in the status bar (defaults to the project badge)\n  badge_url: 'https://example.com/assets/badge.png',\n\n  // optional, an image to display in the notification content\n  // see https://pushpad.xyz/docs/sending_images\n  image_url: 'https://example.com/assets/image.png',\n\n  // optional, drop the notification after this number of seconds if a device is offline\n  ttl: 604800,\n\n  // optional, prevent Chrome on desktop from automatically closing the notification after a few seconds\n  require_interaction: true,\n\n  // optional, enable this option if you want a mute notification without any sound\n  silent: false,\n\n  // optional, enable this option only for time-sensitive alerts (e.g. incoming phone call)\n  urgent: false,\n\n  // optional, a string that is passed as an argument to action button callbacks\n  custom_data: '123',\n\n  // optional, add some action buttons to the notification\n  // see https://pushpad.xyz/docs/action_buttons\n  actions: [\n    {\n      title: 'My Button 1',\n      target_url: 'https://example.com/button-link', // optional\n      icon: 'https://example.com/assets/button-icon.png', // optional\n      action: 'myActionName' // optional\n    }\n  ],\n\n  // optional, bookmark the notification in the Pushpad dashboard (e.g. to highlight manual notifications)\n  starred: true,\n\n  // optional, use this option only if you need to create scheduled notifications (max 5 days)\n  // see https://pushpad.xyz/docs/schedule_notifications\n  send_at: '2016-07-25T10:09:00Z',\n\n  // optional, add the notification to custom categories for stats aggregation\n  // see https://pushpad.xyz/docs/monitoring\n  custom_metrics: ['examples', 'another_metric'] // up to 3 metrics per notification\n};\n\n// deliver to a user\nawait pushpad.notification.create({ ...payload, uids: ['user-1'] });\n\n// deliver to a group of users\nawait pushpad.notification.create({ ...payload, uids: ['user-1', 'user-2', 'user-3'] });\n\n// deliver to some users only if they have a given preference\n// e.g. only \"users\" who have a interested in \"events\" will be reached\nawait pushpad.notification.create({ ...payload, uids: ['user-1', 'user-2'], tags: ['events'] });\n\n// deliver to segments\n// e.g. any subscriber that has the tag \"segment1\" OR \"segment2\"\nawait pushpad.notification.create({ ...payload, tags: ['segment1', 'segment2'] });\n\n// you can use boolean expressions \n// they can include parentheses and the operators !, \u0026\u0026, || (from highest to lowest precedence)\n// https://pushpad.xyz/docs/tags\nawait pushpad.notification.create({ ...payload, tags: ['zip_code:28865 \u0026\u0026 !optout:local_events || friend_of:Organizer123'] });\nawait pushpad.notification.create({ ...payload, tags: ['tag1 \u0026\u0026 tag2', 'tag3'] }); // equal to 'tag1 \u0026\u0026 tag2 || tag3'\n\n// deliver to everyone\nawait pushpad.notification.create(payload);\n```\n\nYou can set the default values for most fields in the project settings. See also [the docs](https://pushpad.xyz/docs/rest_api#notifications_api_docs) for more information about notification fields.\n\nIf you try to send a notification to a user ID, but that user is not subscribed, that ID is simply ignored.\n\nThese fields are also returned by the API:\n\n```javascript\nconst result = await pushpad.notification.create(payload);\n\n// Notification ID\nconsole.log(result.id); // =\u003e 1000\n\n// Estimated number of devices that will receive the notification\n// Not available for notifications that use send_at\nconsole.log(result.scheduled); // =\u003e 5\n\n// Available only if you specify some user IDs (uids) in the request:\n// it indicates which of those users are subscribed to notifications.\n// Not available for notifications that use send_at\nconsole.log(result.uids); // =\u003e [\"user1\", \"user2\"]\n\n// The time when the notification will be sent.\n// Available for notifications that use send_at\nconsole.log(result.send_at); // =\u003e \"2025-10-30T10:09:00.000Z\"\n```\n\n## Getting push notification data\n\nYou can retrieve data for past notifications:\n\n```javascript\nconst notification = await pushpad.notification.find(42);\n\n// get basic attributes\nnotification.id; // =\u003e 42\nnotification.title; // =\u003e 'Foo Bar'\nnotification.body; // =\u003e 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'\nnotification.target_url; // =\u003e 'https://example.com'\nnotification.ttl; // =\u003e 604800\nnotification.require_interaction; // =\u003e false\nnotification.silent; // =\u003e false\nnotification.urgent; // =\u003e false\nnotification.icon_url; // =\u003e 'https://example.com/assets/icon.png'\nnotification.badge_url; // =\u003e 'https://example.com/assets/badge.png'\nnotification.created_at; // =\u003e '2025-07-06T10:09:14.000Z'\n\n// get statistics\nnotification.scheduled_count; // =\u003e 1\nnotification.successfully_sent_count; // =\u003e 4\nnotification.opened_count; // =\u003e 2\n```\n\nOr for multiple notifications of a project at once:\n\n```javascript\nconst notifications = await pushpad.notification.findAll({ page: 1 });\n\n// same attributes as for single notification in example above\nnotifications[0].id; // =\u003e 42\nnotifications[0].title; // =\u003e 'Foo Bar'\n```\n\nThe REST API paginates the result set. You can pass a `page` parameter to get the full list in multiple requests.\n\n```javascript\nconst notifications = await pushpad.notification.findAll({ page: 2 });\n```\n\n## Scheduled notifications\n\nYou can create scheduled notifications that will be sent in the future:\n\n```javascript\nawait pushpad.notification.create({\n  body: 'This notification will be sent after 60 seconds',\n  send_at: new Date(Date.now() + 60_000).toISOString()\n});\n```\n\nYou can also cancel a scheduled notification:\n\n```javascript\nawait pushpad.notification.cancel(id);\n```\n\n## Getting subscription count\n\nYou can retrieve the number of subscriptions for a given project, optionally filtered by `tags` or `uids`:\n\n```javascript\nawait pushpad.subscription.count(); // =\u003e 100\nawait pushpad.subscription.count({ uids: ['user1'] }); // =\u003e 2\nawait pushpad.subscription.count({ tags: ['sports'] }); // =\u003e 10\nawait pushpad.subscription.count({ tags: ['sports \u0026\u0026 travel'] }); // =\u003e 5\nawait pushpad.subscription.count({ uids: ['user1'], tags: ['sports \u0026\u0026 travel'] }); // =\u003e 1\n```\n\n## Getting push subscription data\n\nYou can retrieve the subscriptions for a given project, optionally filtered by `tags` or `uids`:\n\n```javascript\nawait pushpad.subscription.findAll();\nawait pushpad.subscription.findAll({ uids: ['user1'] });\nawait pushpad.subscription.findAll({ tags: ['sports'] });\nawait pushpad.subscription.findAll({ tags: ['sports \u0026\u0026 travel'] });\nawait pushpad.subscription.findAll({ uids: ['user1'], tags: ['sports \u0026\u0026 travel'] });\n```\n\nThe REST API paginates the result set. You can pass a `page` parameter to get the full list in multiple requests.\n\n```javascript\nconst subscriptions = await pushpad.subscription.findAll({ page: 2 });\n```\n\nYou can also retrieve the data of a specific subscription if you already know its id:\n\n```javascript\nawait pushpad.subscription.find(123);\n```\n\n## Updating push subscription data\n\nUsually you add data, like user IDs and tags, to the push subscriptions using the [JavaScript SDK](https://pushpad.xyz/docs/javascript_sdk_reference) in the frontend.\n\nHowever you can also update the subscription data from your server:\n\n```javascript\nconst subscriptions = await pushpad.subscription.findAll({ uids: ['user1'] });\n\nfor (const subscription of subscriptions) {\n  // update the user ID associated to the push subscription\n  await pushpad.subscription.update(subscription.id, { uid: 'myuser1' });\n  \n  // update the tags associated to the push subscription\n  const tags = [...(subscription.tags ?? [])];\n  tags.push('another_tag');\n  await pushpad.subscription.update(subscription.id, { tags });\n}\n```\n\n## Importing push subscriptions\n\nIf you need to [import](https://pushpad.xyz/docs/import) some existing push subscriptions (from another service to Pushpad, or from your backups) or if you simply need to create some test data, you can use this method:\n\n```javascript\nconst attributes = {\n  endpoint: 'https://example.com/push/f7Q1Eyf7EyfAb1', \n  p256dh: 'BCQVDTlYWdl05lal3lG5SKr3VxTrEWpZErbkxWrzknHrIKFwihDoZpc_2sH6Sh08h-CacUYI-H8gW4jH-uMYZQ4=',\n  auth: 'cdKMlhgVeSPzCXZ3V7FtgQ==',\n  uid: 'exampleUid', \n  tags: ['exampleTag1', 'exampleTag2']\n};\n\nconst subscription = await pushpad.subscription.create(attributes);\n```\n\nPlease note that this is not the standard way to collect subscriptions on Pushpad: usually you subscribe the users to the notifications using the [JavaScript SDK](https://pushpad.xyz/docs/javascript_sdk_reference) in the frontend.\n\n## Deleting push subscriptions\n\nUsually you unsubscribe a user from push notifications using the [JavaScript SDK](https://pushpad.xyz/docs/javascript_sdk_reference) in the frontend (recommended).\n\nHowever you can also delete the subscriptions using this library. Be careful, the subscriptions are permanently deleted!\n\n```javascript\nawait pushpad.subscription.delete(id);\n```\n\n## Managing projects\n\nProjects are usually created manually from the Pushpad dashboard. However you can also create projects from code if you need advanced automation or if you manage [many different domains](https://pushpad.xyz/docs/multiple_domains).\n\n```javascript\nconst attributes = {\n  // required attributes\n  sender_id: 123,\n  name: 'My project',\n  website: 'https://example.com',\n  \n  // optional configurations\n  icon_url: 'https://example.com/icon.png',\n  badge_url: 'https://example.com/badge.png',\n  notifications_ttl: 604800,\n  notifications_require_interaction: false,\n  notifications_silent: false\n};\n\nconst project = await pushpad.project.create(attributes);\n```\n\nYou can also find, update and delete projects:\n\n```javascript\nconst projects = await pushpad.project.findAll();\nprojects.forEach((p) =\u003e {\n  console.log(`Project ${p.id}: ${p.name}`);\n});\n\nconst existingProject = await pushpad.project.find(123);\n\nawait pushpad.project.update(existingProject.id, { name: 'The New Project Name' });\n\nawait pushpad.project.delete(existingProject.id);\n```\n\n## Managing senders\n\nSenders are usually created manually from the Pushpad dashboard. However you can also create senders from code.\n\n```javascript\nconst attributes = {\n  // required attributes\n  name: 'My sender',\n  \n  // optional configurations\n  // do not include these fields if you want to generate them automatically\n  vapid_private_key: '-----BEGIN EC PRIVATE KEY----- ...',\n  vapid_public_key: '-----BEGIN PUBLIC KEY----- ...'\n};\n\nconst sender = await pushpad.sender.create(attributes);\n```\n\nYou can also find, update and delete senders:\n\n```javascript\nconst senders = await pushpad.sender.findAll();\nsenders.forEach((s) =\u003e {\n  console.log(`Sender ${s.id}: ${s.name}`);\n});\n\nconst existingSender = await pushpad.sender.find(987);\n\nawait pushpad.sender.update(existingSender.id, { name: 'The New Sender Name' });\n\nawait pushpad.sender.delete(existingSender.id);\n```\n\n## Error handling\n\nAll API requests return promises. Failed requests throw a `PushpadError` that exposes the HTTP status, response body, headers, and request metadata:\n\n```javascript\nimport { PushpadError } from 'pushpad';\n\ntry {\n  await pushpad.notification.create({ body: 'Hello' });\n} catch (error) {\n  if (error instanceof PushpadError) {\n    console.error(error.status, error.body);\n  }\n}\n```\n\n## TypeScript support\n\nType definitions ship with the package (`index.d.ts`) and cover all resources, input types, and response shapes. Importing from TypeScript works out of the box:\n\n```typescript\nimport Pushpad from 'pushpad';\n\n// types are inferred automatically from type definitions in the package\nconst client = new Pushpad({ authToken: 'token', projectId: 123 });\nconst result = await client.notification.create({ body: 'Hello' });\n```\n\n## Documentation\n\n- Pushpad REST API reference: https://pushpad.xyz/docs/rest_api\n- Getting started guide (for collecting subscriptions): https://pushpad.xyz/docs/pushpad_pro_getting_started\n- JavaScript SDK reference (frontend): https://pushpad.xyz/docs/javascript_sdk_reference\n\n## License\n\nThe package is available as open source under the terms of the [MIT License](https://opensource.org/license/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushpad%2Fpushpad-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpushpad%2Fpushpad-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushpad%2Fpushpad-node/lists"}