{"_id":"@adarshctas/live-notification","_rev":"8-12a0d9322ba06e0355d4f49ef98c2ec5","name":"@adarshctas/live-notification","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.2":{"name":"@adarshctas/live-notification","version":"0.0.2","_id":"@adarshctas/live-notification@0.0.2","maintainers":[{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"}],"dist":{"shasum":"329484cce534cd56f589857c63f93d52ef9a1b72","tarball":"https://registry.npmjs.org/@adarshctas/live-notification/-/live-notification-0.0.2.tgz","fileCount":5,"integrity":"sha512-mYS0hB7gvcP7c0CAx4IVWIBsMxn/WG3d4DeGRaFwnV/bn8q6VENY6YDYlMxdn8/s15IgcIPPs3KZikjqI8jZEg==","signatures":[{"sig":"MEUCIQDwZGAtroYDh06FpLNNu3190CdyR5JCET4AQg+OgKoYVQIgc0/AGoK7DSIfTb3rM/9G1ROZbrYdOuOQEEVgDb35/xM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4553},"type":"module","module":"fesm2022/adarshctas-live-notification.mjs","exports":{".":{"types":"./types/adarshctas-live-notification.d.ts","default":"./fesm2022/adarshctas-live-notification.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"693d81177b7971709f29c0f4fec2b4010ec684af","typings":"types/adarshctas-live-notification.d.ts","_npmUser":{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"},"_npmVersion":"11.6.2","description":"This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.0.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^21.2.0","@angular/common":"^21.2.0"},"_npmOperationalInternal":{"tmp":"tmp/live-notification_0.0.2_1779429580309_0.833795211714204","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@adarshctas/live-notification","version":"0.0.3","_id":"@adarshctas/live-notification@0.0.3","maintainers":[{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"}],"dist":{"shasum":"03d46e8873503f08d214fa53355fb7760e4c0be0","tarball":"https://registry.npmjs.org/@adarshctas/live-notification/-/live-notification-0.0.3.tgz","fileCount":5,"integrity":"sha512-R7+D45zO/eg2t/7fGeQ6cnvs98BE2rKtb4psD0Hglmndu1Qj3tvSVixI2SGI2Sl7JCDqD8HFoyzn4VYlAWKNlQ==","signatures":[{"sig":"MEQCIBW5IsJ/quUx1w7CG/YwVXezoKJcOTF9AHUTtAlDnwsMAiBgCfJQeH1TYd4jzAdfGcAmi2j7ynARZEQQL171AyS/pg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62959},"type":"module","module":"fesm2022/adarshctas-live-notification.mjs","exports":{".":{"types":"./types/adarshctas-live-notification.d.ts","default":"./fesm2022/adarshctas-live-notification.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"693d81177b7971709f29c0f4fec2b4010ec684af","typings":"types/adarshctas-live-notification.d.ts","_npmUser":{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"},"_npmVersion":"11.6.2","description":"Angular notification library for showing notifications/messages in Angular applications.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^21.2.0","@angular/common":"^21.2.0"},"_npmOperationalInternal":{"tmp":"tmp/live-notification_0.0.3_1779443702431_0.0718265041374242","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@adarshctas/live-notification","version":"0.0.4","_id":"@adarshctas/live-notification@0.0.4","maintainers":[{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"}],"dist":{"shasum":"2262e56c49f591995e9d73b7920a1b844e93516c","tarball":"https://registry.npmjs.org/@adarshctas/live-notification/-/live-notification-0.0.4.tgz","fileCount":5,"integrity":"sha512-dREzEv4zvWbd8Vcs5JyDibJBTjilIV1gYej3+EWW7YTHhTjKyH/3VYPrlTz1ZHGt4z2vR7HA044h5v+7lkxrng==","signatures":[{"sig":"MEYCIQCH7Ot2tQT+tjEl1Yt93F9LhdjZDUYy1LhEThikV/wDRAIhAOG6yYxVSlBOk874X/3tjYZPPjrcATrlZjl693JtYsno","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65832},"type":"module","module":"fesm2022/adarshctas-live-notification.mjs","exports":{".":{"types":"./types/adarshctas-live-notification.d.ts","default":"./fesm2022/adarshctas-live-notification.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"693d81177b7971709f29c0f4fec2b4010ec684af","typings":"types/adarshctas-live-notification.d.ts","_npmUser":{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"},"_npmVersion":"11.6.2","description":"A lightweight Angular notification library for real-time notifications, toast messages, alerts, and in-app notifications.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^21.2.0","@angular/common":"^21.2.0"},"_npmOperationalInternal":{"tmp":"tmp/live-notification_0.0.4_1779691531053_0.5304003119127314","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@adarshctas/live-notification","version":"0.0.5","peerDependencies":{"@angular/common":"^21.2.0","@angular/core":"^21.2.0"},"dependencies":{"tslib":"^2.3.0"},"sideEffects":false,"module":"fesm2022/adarshctas-live-notification.mjs","typings":"types/adarshctas-live-notification.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./types/adarshctas-live-notification.d.ts","default":"./fesm2022/adarshctas-live-notification.mjs"}},"type":"module","gitHead":"01e2f837c1ebb662e7c747992ae5f88a5c8500d3","_id":"@adarshctas/live-notification@0.0.5","description":"A lightweight Angular notification library for real-time notifications, toast messages, alerts, and in-app notifications.","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-blGUYsMPqnFPVaJHeZ77Y6IGLGLkiFgOeq+nqH2JjzjHXVOlUWmJaIk3vvobNV94Z5DOt4pNlbpFzY6okP4YJQ==","shasum":"c0219544597b968bfe039a0230dc25379a865883","tarball":"https://registry.npmjs.org/@adarshctas/live-notification/-/live-notification-0.0.5.tgz","fileCount":5,"unpackedSize":99251,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCghDcJEEWnfbyskeuJor4lRsE+t3vheHbaBFVrouXbHQIgHbsSR/xEJIkeQGPn5V6HK1uCYh2k35dzYWqgHjFYd0g="}]},"_npmUser":{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"},"directories":{},"maintainers":[{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/live-notification_0.0.5_1779719535519_0.5909835333271631"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T05:59:40.142Z","modified":"2026-05-25T14:32:15.781Z","0.1.55":"2026-05-20T12:02:00.336Z","0.1.56":"2026-05-20T13:43:58.098Z","0.0.2":"2026-05-22T05:59:40.450Z","0.0.3":"2026-05-22T09:55:02.564Z","0.0.4":"2026-05-25T06:45:31.194Z","0.0.5":"2026-05-25T14:32:15.666Z"},"description":"A lightweight Angular notification library for real-time notifications, toast messages, alerts, and in-app notifications.","maintainers":[{"name":"adarshctas","email":"adarsh.ctasis.llp@gmail.com"}],"readme":"# @adarshctas/live-notification\n\nA lightweight Angular notification library for real-time notifications, toast messages, alerts, and in-app notifications.\n\n## ✨ Features\n\n- 🔔 Real-time notifications using Socket.IO\n- 📡 REST API support (send / fetch / mark as read)\n- 🍞 Toast notifications (success, error, warning, info)\n- 📊 Multiple notification modes (`alert` / `toast` / `inapp`)\n- 🎯 Filter notifications by type\n- ✅ Mark notifications as read\n- 🔌 Easy Angular integration\n- 🧹 Auto cleanup socket listeners\n\n---\n\n## 📦 Installation\n\nInstall the package using npm:\n\n```bash\nnpm install @adarshctas/live-notification\n```\n\n---\n\n## 📋 Requirements\n\nMake sure your Angular project has the following dependencies:\n\n```json\n{\n  \"@angular/core\": \">=15.0.0\",\n  \"@angular/common\": \">=15.0.0\",\n  \"@angular/common/http\": \">=15.0.0\",\n  \"rxjs\": \">=6.5.0\"\n}\n```\n\n---\n\n## 🚀 Quick Start\n\n### 1. Import Notification Service\n\n```ts\nimport { Notification } from '@adarshctas/live-notification';\n```\n\n---\n\n### 2. Inject Service Inside Component\n\n```ts\nconstructor(private notification: Notification) {}\n```\n\n---\n\n### 3. Initialize Notifications\n\nSubscribe to real-time notifications inside `ngOnInit()`:\n\n```ts\nngOnInit() {\n  this.notification.listenNotification()\n    .subscribe(data => {\n      console.log('New Notification:', data);\n    });\n}\n```\n\n---\n\n## 🔔 Notification Modes\n\nThis library supports 3 notification modes:\n\n### Toast Notification\n\nTemporary popup message.\n\n```ts\nsetToastMode() {\n  this.notification.setActiveType('toast');\n\n  this.notification.toast({\n    message: 'Saved successfully!',\n    type: 'success'\n  });\n}\n```\n\n---\n\n### Alert Notification\n\nSimple alert popup.\n\n```ts\nsetAlertMode() {\n  this.notification.setActiveType('alert');\n\n  this.notification.show('This is an alert notification');\n}\n```\n\n---\n\n### In-App Notification\n\nStructured notification inside the application.\n\n```ts\nsetInAppMode() {\n  this.notification.setActiveType('inapp');\n\n  this.notification.notify({\n    title: 'New Message',\n    message: 'You received a notification',\n    type: 'info'\n  });\n}\n```\n\n---\n\n## 📌 API Methods\n\n### `show()`\n\nShow a simple alert notification.\n\n```ts\nthis.notification.show('Notification message');\n```\n\n---\n\n### `toast()`\n\nDisplay a toast message.\n\n```ts\nthis.notification.toast({\n  message: 'Data saved successfully',\n  type: 'success'\n});\n```\n\nTypes supported:\n\n- `success`\n- `error`\n- `warning`\n- `info`\n\n---\n\n### `notify()`\n\nSend a structured notification.\n\n```ts\nthis.notification.notify({\n  title: 'Notification Title',\n  message: 'Notification message',\n  type: 'info'\n});\n```\n\n---\n\n### `listenNotification()`\n\nListen for real-time notifications.\n\n```ts\nthis.notification.listenNotification()\n  .subscribe(data => {\n    console.log(data);\n  });\n```\n\n---\n\n### `setActiveType()`\n\nSet notification display mode.\n\n```ts\nthis.notification.setActiveType('toast');\n```\n\nAvailable modes:\n\n```ts\n'toast'\n'alert'\n'inapp'\n```\n\n---\n\n### `requestPermission()`\n\nRequest browser notification permission.\n\n```ts\nthis.notification.requestPermission();\n```\n\n---\n\n## 🧩 Example Component\n\n```ts\nimport { Component, OnInit } from '@angular/core';\nimport { Notification } from '@adarshctas/live-notification';\n\n@Component({\n  selector: 'app-home',\n  templateUrl: './home.component.html'\n})\nexport class HomeComponent implements OnInit {\n\n  constructor(private notification: Notification) {}\n\n  ngOnInit() {\n    this.notification.listenNotification()\n      .subscribe(data => {\n        console.log('New Notification:', data);\n      });\n  }\n\n  showToast() {\n    this.notification.setActiveType('toast');\n\n    this.notification.toast({\n      message: 'Login Successful',\n      type: 'success'\n    });\n  }\n\n  showAlert() {\n    this.notification.setActiveType('alert');\n    this.notification.show('Alert Notification');\n  }\n\n  showInApp() {\n    this.notification.setActiveType('inapp');\n\n    this.notification.notify({\n      title: 'Welcome',\n      message: 'New notification arrived',\n      type: 'info'\n    });\n  }\n}\n```\n\n---\n\n## 🎯 Summary\n\n| Method | Description |\n|---------|-------------|\n| `show()` | Simple alert notification |\n| `toast()` | Temporary popup notification |\n| `notify()` | Structured in-app notification |\n| `listenNotification()` | Listen to notifications |\n| `setActiveType()` | Change notification mode |\n| `requestPermission()` | Ask browser permission |\n\n---\n\n## 🛠 Maintainer\n\nDeveloped by **Adarsh Ctasis LLP**\n\n---\n\n## 📄 License\n\nMIT License © Adarsh Ctasis LLP","readmeFilename":"README.md"}