{"_id":"@acquachris/ntfy","_rev":"4-8be148a818a6fb31d91b7dbaaf4f67da","name":"@acquachris/ntfy","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@acquachris/ntfy","version":"1.0.0","keywords":["ntfy","notifications"],"author":{"name":"acquachris"},"license":"MIT","_id":"@acquachris/ntfy@1.0.0","maintainers":[{"name":"acquachris","email":"acquachris138@gmail.com"}],"homepage":"https://github.com/acquachris/ntfy#readme","bugs":{"url":"https://github.com/acquachris/ntfy/issues"},"dist":{"shasum":"dfa1c029e014b0371409bd67a8b9d1b9f314abbc","tarball":"https://registry.npmjs.org/@acquachris/ntfy/-/ntfy-1.0.0.tgz","fileCount":17,"integrity":"sha512-BWWhudLPYdqG3jjc7FOFAc+jAqH1mcDnnSvdb9oeAMpl79TS1WslC05VBJogSR1jkMm81EUR+IrSQLkLCZjC9g==","signatures":[{"sig":"MEUCIQDvyidBJupmWY39BjowbcyNsdKwHoIzTasayXAL/tqO0gIgeEtaXEMjWnnYrK6TXIi9A+XQ+hRntW3JpaNzvTyb588=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9489},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"195e1931648ffb281dc7a3d0251de776f38beb61","scripts":{"dev":"tsx watch src/index.ts","build":"tsc --project tsconfig.json && tsc-alias -p tsconfig.json","start":"node .","prepublishOnly":"npm run build"},"_npmUser":{"name":"acquachris","email":"acquachris138@gmail.com"},"repository":{"url":"git+https://github.com/acquachris/ntfy.git","type":"git"},"_npmVersion":"11.6.2","description":"A package to send notifications to a ntfy server.","directories":{},"_nodeVersion":"24.0.2","dependencies":{"axios":"^1.13.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsc-alias":"^1.8.10","typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/ntfy_1.0.0_1763661050349_0.2914575147042262","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@acquachris/ntfy","version":"1.0.1","keywords":["ntfy","notifications"],"author":{"name":"acquachris"},"license":"MIT","_id":"@acquachris/ntfy@1.0.1","maintainers":[{"name":"acquachris","email":"acquachris138@gmail.com"}],"homepage":"https://github.com/acquachris/ntfy#readme","bugs":{"url":"https://github.com/acquachris/ntfy/issues"},"dist":{"shasum":"f1afe4534768f3c0cff630a202cf32b7891e488d","tarball":"https://registry.npmjs.org/@acquachris/ntfy/-/ntfy-1.0.1.tgz","fileCount":17,"integrity":"sha512-930RgDkzGTp9LvhQGrEpaJax07opyBz0gxs6asxqRm1l4oDgLMo0BZ8/KLVQkXXoQ8LmT0TuHlbXT31vIfomSw==","signatures":[{"sig":"MEUCIQDF3ok2D+ihUmOTFliJ1PhX9h4LaBnMbo82jy1aEkTfZgIgbkL2vkA+5eoLVOllf7guo/ltg9Wm5x9xIoMSQiyAaVo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9489},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"0a720171ed6e52e60db44d67ca4e892ee4046803","scripts":{"dev":"tsx watch src/index.ts","build":"tsc --project tsconfig.json && tsc-alias -p tsconfig.json","start":"node .","prepublishOnly":"npm run build"},"_npmUser":{"name":"acquachris","email":"acquachris138@gmail.com"},"repository":{"url":"git+https://github.com/acquachris/ntfy.git","type":"git"},"_npmVersion":"11.6.2","description":"A package to send notifications to a ntfy server.","directories":{},"_nodeVersion":"24.0.2","dependencies":{"axios":"^1.13.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsc-alias":"^1.8.10","typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/ntfy_1.0.1_1763661403096_0.059906213997450664","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@acquachris/ntfy","version":"1.0.2","keywords":["ntfy","notifications"],"author":{"name":"acquachris"},"license":"MIT","_id":"@acquachris/ntfy@1.0.2","maintainers":[{"name":"acquachris","email":"acquachris138@gmail.com"}],"homepage":"https://github.com/acquachris/ntfy#readme","bugs":{"url":"https://github.com/acquachris/ntfy/issues"},"dist":{"shasum":"4773a1eceb2c672cb9f491debfbfc740740b2804","tarball":"https://registry.npmjs.org/@acquachris/ntfy/-/ntfy-1.0.2.tgz","fileCount":17,"integrity":"sha512-GUIXcn/kx6uIDu9uFi+L8UI+u1IkHw3n80eC0hZgdN+GRH4u9XAD+0yMh419hp6oZ2mGzSaYHczOYBrE9eUsfQ==","signatures":[{"sig":"MEQCIH3Tm6Jqi99XOAKZJuYWKTSjZbgnq7taQR4hrbK1uyfWAiA1H/UQhOkrLMcxwiGlA8rrFnlw3ad4w3m20m8FQfYRiQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12508},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"4d4f6c704d468c66ffdde30ccaaeffbcf75c05d0","scripts":{"dev":"tsx watch src/index.ts","build":"tsc --project tsconfig.json && tsc-alias -p tsconfig.json","start":"node .","prepublishOnly":"npm run build"},"_npmUser":{"name":"acquachris","email":"acquachris138@gmail.com"},"repository":{"url":"git+https://github.com/acquachris/ntfy.git","type":"git"},"_npmVersion":"11.6.2","description":"A package to send notifications to a ntfy server.","directories":{},"_nodeVersion":"24.0.2","dependencies":{"axios":"^1.13.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsc-alias":"^1.8.10","typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/ntfy_1.0.2_1763661880609_0.6100620704818884","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@acquachris/ntfy","version":"1.0.3","description":"A package to send notifications to a ntfy server.","keywords":["ntfy","notifications"],"homepage":"https://github.com/acquachris/ntfy#readme","bugs":{"url":"https://github.com/acquachris/ntfy/issues"},"repository":{"type":"git","url":"git+https://github.com/acquachris/ntfy.git"},"license":"MIT","author":{"name":"acquachris"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"tsx watch src/index.ts","build":"tsc --project tsconfig.json && tsc-alias -p tsconfig.json","start":"node .","prepublishOnly":"npm run build"},"devDependencies":{"@types/node":"^24.10.1","tsc-alias":"^1.8.10","tsx":"^4.19.2","typescript":"^5.9.3"},"dependencies":{"axios":"^1.13.2"},"gitHead":"7235df0d08e11f4bf35f37e1a93b5ac186f22ae2","_id":"@acquachris/ntfy@1.0.3","_nodeVersion":"24.0.2","_npmVersion":"11.6.2","dist":{"integrity":"sha512-AG+Zmh/ztwgZ9ygFSfSky9xzZh79tk37JYJ6mQN0RK9iAXi3Mb6Hp4m9dAx3WFm/Tpfnq/CkOMA18kKFMT4GQg==","shasum":"8a48732c39fe2b2af4789bd4d61a5fbd5326ba8f","tarball":"https://registry.npmjs.org/@acquachris/ntfy/-/ntfy-1.0.3.tgz","fileCount":17,"unpackedSize":12508,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD6tAInlOodxqtP4nt0NmnbrviEx/Gw428W/zkP7xmv9wIhALTFEPSFZYuO8HK5NMPJXAjohoPu7Tfs7UYvFbri1/bQ"}]},"_npmUser":{"name":"acquachris","email":"acquachris138@gmail.com"},"directories":{},"maintainers":[{"name":"acquachris","email":"acquachris138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ntfy_1.0.3_1763661962120_0.23489620435836578"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-20T17:50:50.258Z","modified":"2025-11-20T18:06:02.504Z","1.0.0":"2025-11-20T17:50:50.545Z","1.0.1":"2025-11-20T17:56:43.283Z","1.0.2":"2025-11-20T18:04:40.800Z","1.0.3":"2025-11-20T18:06:02.326Z"},"bugs":{"url":"https://github.com/acquachris/ntfy/issues"},"author":{"name":"acquachris"},"license":"MIT","homepage":"https://github.com/acquachris/ntfy#readme","keywords":["ntfy","notifications"],"repository":{"type":"git","url":"git+https://github.com/acquachris/ntfy.git"},"description":"A package to send notifications to a ntfy server.","maintainers":[{"name":"acquachris","email":"acquachris138@gmail.com"}],"readme":"# NTFY Client (Unofficial)\r\n\r\nThis package was originally created for **my personal project**, and I decided to publish it in case it helps someone else.\r\n\r\n⚠️ **Important notes:**\r\n\r\n- This is **not an official** NTFY client.  \r\n- The project is **not actively maintained**.  \r\n- APIs may change, break, or be incomplete.  \r\n- Use it at your own risk.\r\n\r\nIf you want something stable or feature-complete, you should probably look for an official or community-maintained library instead.\r\n\r\n# Usage\r\n\r\n## Installation\r\n```bash\r\nnpm install @acquachris/ntfy-client\r\n```\r\n\r\n## Quick Start\r\n\r\n### ES Modules\r\n```typescript\r\nimport { NTFYClient, NTFYAuthType, NTFYActionButtonBuilder } from \"@acquachris/ntfy-client\";\r\n\r\nconst client = new NTFYClient({\r\n  baseUrl: \"https://ntfy.acquachris.it\",\r\n  auth: {\r\n    type: NTFYAuthType.Token,\r\n    token: \"YOUR_TOKEN_HERE\"\r\n  }\r\n});\r\n\r\n// Send a simple message\r\nawait client.SendMessage(\"test\", {\r\n  message: \"test message\",\r\n  title: \"test title\"\r\n});\r\n```\r\n\r\n### CommonJS\r\n```javascript\r\nconst { NTFYClient, NTFYAuthType, NTFYActionButtonBuilder } = require(\"@acquachris/ntfy-client\");\r\n\r\nconst client = new NTFYClient({\r\n  baseUrl: \"https://ntfy.acquachris.it\",\r\n  auth: {\r\n    type: NTFYAuthType.Token,\r\n    token: \"YOUR_TOKEN_HERE\"\r\n  }\r\n});\r\n\r\n// Send a simple message\r\nawait client.SendMessage(\"test\", {\r\n  message: \"test message\",\r\n  title: \"test title\"\r\n});\r\n```\r\n\r\n## Examples\r\n\r\n### Basic Message\r\n```typescript\r\nconst client = new NTFYClient({\r\n  baseUrl: \"https://ntfy.sh\"\r\n});\r\n\r\nawait client.SendMessage(\"my-topic\", {\r\n  message: \"Hello from ntfy!\",\r\n  title: \"Notification\"\r\n});\r\n```\r\n\r\n### Authentication\r\n\r\n#### Token Authentication\r\n```typescript\r\nconst client = new NTFYClient({\r\n  baseUrl: \"https://ntfy.sh\",\r\n  auth: {\r\n    type: NTFYAuthType.Token,\r\n    token: \"tk_your_token_here\"\r\n  }\r\n});\r\n```\r\n\r\n#### Basic Authentication\r\n```typescript\r\nconst client = new NTFYClient({\r\n  baseUrl: \"https://ntfy.sh\",\r\n  auth: {\r\n    type: NTFYAuthType.Basic,\r\n    username: \"your_username\",\r\n    password: \"your_password\"\r\n  }\r\n});\r\n```\r\n\r\n### Adding Action Buttons\r\n```typescript\r\nconst button = new NTFYActionButtonBuilder()\r\n  .SetType(\"view\")\r\n  .SetUrl(\"https://example.com/login\")\r\n  .SetLabel(\"Open Login\");\r\n\r\nawait client.SendMessage(\"test\", {\r\n  message: \"Click the button below to login\",\r\n  title: \"Action Required\",\r\n  actions: [button]\r\n});\r\n```\r\n\r\n### Multiple Actions\r\n```typescript\r\nconst viewButton = new NTFYActionButtonBuilder()\r\n  .SetType(\"view\")\r\n  .SetUrl(\"https://example.com\")\r\n  .SetLabel(\"View Details\");\r\n\r\nconst httpButton = new NTFYActionButtonBuilder()\r\n  .SetType(\"http\")\r\n  .SetUrl(\"https://api.example.com/confirm\")\r\n  .SetLabel(\"Confirm\");\r\n\r\nawait client.SendMessage(\"notifications\", {\r\n  message: \"Your order has been processed\",\r\n  title: \"Order Confirmation\",\r\n  actions: [viewButton, httpButton]\r\n});\r\n```\r\n\r\n## API Reference\r\n\r\n### `NTFYClient`\r\n\r\nConstructor options:\r\n- `baseUrl` (optional): The ntfy server URL. Default: `\"https://ntfy.sh\"`\r\n- `auth` (optional): Authentication configuration\r\n\r\n### `NTFYAuthType`\r\n\r\nEnum values:\r\n- `NTFYAuthType.None`: No authentication\r\n- `NTFYAuthType.Token`: Token-based authentication\r\n- `NTFYAuthType.Basic`: Basic username/password authentication\r\n\r\n### `SendMessage(topic: string, options: MessageOptions)`\r\n\r\nSend a notification to a specific topic.\r\n\r\nOptions:\r\n- `message`: The notification message (required)\r\n- `title`: The notification title (optional)\r\n- `actions`: Array of action buttons (optional)\r\n\r\nReturns: `Promise<void>`","readmeFilename":"README.md"}