{"_id":"@ambita/status-notification-subscriber","_rev":"10-367d74576d0fabb6ef2936336c58523f","name":"@ambita/status-notification-subscriber","dist-tags":{"latest":"1.1.0","beta":"1.1.0-beta.1"},"versions":{"1.0.0":{"name":"@ambita/status-notification-subscriber","version":"1.0.0","keywords":[],"author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"license":"ISC","_id":"@ambita/status-notification-subscriber@1.0.0","maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"dist":{"shasum":"39f19437b048913ef4dea0cdab2f7336d063212a","tarball":"https://registry.npmjs.org/@ambita/status-notification-subscriber/-/status-notification-subscriber-1.0.0.tgz","fileCount":4,"integrity":"sha512-12xT7wRnsWo1/8x/a4xOCbexKo5kMCenWmv42tFDB743jlQwDXjhd+Leu+sS+fLRnOpmkomOfyLxp75wwhX4Bw==","signatures":[{"sig":"MEYCIQDllXmD2rCCSYA72dyGL25h3w7y4fFgskXIIT/4lCnZOgIhAPhWnoZKY/SrGm656lhxMI+JNXLG9/ixVFfWD9+MzyuD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9095},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"706d8d2e9ffefd22cc452d9d23be003967e2f434","scripts":{"bundle":"npx tsc && npx rollup -c","localdist":"rm -f ambita-status-notification-subscriber-*.tgz && npm pack && npm i -g ambita-status-notification-subscriber-*.tgz"},"_npmUser":{"name":"ambitadrift","email":"drift@ambita.com"},"_npmVersion":"10.8.2","description":"Ambita's lightweight library designed for frontend applications to fetch and subscribe to updated notifications by subscribing to topic.","directories":{},"_nodeVersion":"20.18.0","dependencies":{"aws-iot-device-sdk-v2":"^1.21.1","@aws-sdk/util-utf8-browser":"^3.259.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.27.4","typescript":"^5.7.2","patch-package":"^8.0.0","rollup-plugin-dts":"^6.1.1","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-node-resolve":"^15.3.0"},"_npmOperationalInternal":{"tmp":"tmp/status-notification-subscriber_1.0.0_1733143928970_0.9030991417640546","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@ambita/status-notification-subscriber","version":"1.0.1","keywords":[],"author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"license":"ISC","_id":"@ambita/status-notification-subscriber@1.0.1","maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"dist":{"shasum":"0d40cec6e31c2881b3e33851674ca00d2d9199a6","tarball":"https://registry.npmjs.org/@ambita/status-notification-subscriber/-/status-notification-subscriber-1.0.1.tgz","fileCount":4,"integrity":"sha512-3q91N4rHT7mKuAyUoE9n7kwTOfm488kj6QRN8XXaOHknBOKX1FRMGsXlB5blp1sD6cVteLOBxm0zanDZgXjzFg==","signatures":[{"sig":"MEYCIQCoAOShnPvob38FQpEO4dZYqCqLfykVvmPBcJOvor+O2AIhAOetc/1PPP9S7Z/jf1TwYW2QwDyJnvPhn4MLjmbqzyi+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9095},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"0c714286f37a8ad3584c5432888da49f7f64bd2f","scripts":{"bundle":"npx tsc && npx rollup -c","localdist":"rm -f ambita-status-notification-subscriber-*.tgz && npm pack && npm i -g ambita-status-notification-subscriber-*.tgz"},"_npmUser":{"name":"ambitadrift","email":"drift@ambita.com"},"_npmVersion":"10.8.2","description":"Ambita's lightweight library designed for frontend applications to fetch and subscribe to updated notifications by subscribing to topic.","directories":{},"_nodeVersion":"20.18.0","dependencies":{"aws-iot-device-sdk-v2":"^1.21.1","@aws-sdk/util-utf8-browser":"^3.259.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.27.4","typescript":"^5.7.2","patch-package":"^8.0.0","rollup-plugin-dts":"^6.1.1","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-node-resolve":"^15.3.0"},"_npmOperationalInternal":{"tmp":"tmp/status-notification-subscriber_1.0.1_1733146311152_0.7246748273597772","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@ambita/status-notification-subscriber","version":"1.0.2","keywords":[],"author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"license":"ISC","_id":"@ambita/status-notification-subscriber@1.0.2","maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"dist":{"shasum":"d2ff41482f5b0005c6e6d694280d9127447d16b2","tarball":"https://registry.npmjs.org/@ambita/status-notification-subscriber/-/status-notification-subscriber-1.0.2.tgz","fileCount":4,"integrity":"sha512-eIQQ6tk4jZ37FUhLGfX7/xMuB1RF4rJBf+kjPy/SPbKYMRvBnQihISTcUrm804ciNzsQCnJN/FZG/e4PUUbleQ==","signatures":[{"sig":"MEUCIQC7JVPKiyLYzFljuwbGnPzw/hd5CvBnSe2Qi3Q3h2n3zQIgVVCg0q3ZOrl6k+/YX7CLOhAFCppfgTcy5QP9/UDWm8Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9088},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"7e153b4da854e40088fc09a1732ebbabbc588a9b","scripts":{"bundle":"npx tsc && npx rollup -c","localdist":"rm -f ambita-status-notification-subscriber-*.tgz && npm pack && npm i -g ambita-status-notification-subscriber-*.tgz"},"_npmUser":{"name":"ambitadrift","email":"drift@ambita.com"},"_npmVersion":"10.8.2","description":"Ambita's lightweight library designed for frontend applications to fetch and subscribe to updated notifications by subscribing to topic.","directories":{},"_nodeVersion":"20.18.0","dependencies":{"aws-iot-device-sdk-v2":"^1.21.1","@aws-sdk/util-utf8-browser":"^3.259.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.27.4","typescript":"^5.7.2","patch-package":"^8.0.0","rollup-plugin-dts":"^6.1.1","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-node-resolve":"^15.3.0"},"_npmOperationalInternal":{"tmp":"tmp/status-notification-subscriber_1.0.2_1737485649617_0.25358682863475224","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@ambita/status-notification-subscriber","version":"1.0.3","keywords":[],"author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"license":"ISC","_id":"@ambita/status-notification-subscriber@1.0.3","maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"dist":{"shasum":"ee347c36bc0108290c045bd5007b80250ee8e54b","tarball":"https://registry.npmjs.org/@ambita/status-notification-subscriber/-/status-notification-subscriber-1.0.3.tgz","fileCount":4,"integrity":"sha512-lP2Vy+nhwFSTRsnHcruGrr0t+TR0NXe31YzBWeDGcOmiIV0LUNDlibmRVzmNqw0QaNqfUOtywMTsUJDxoRGaqw==","signatures":[{"sig":"MEUCIE2eiJ8y57witQ3f0EHRvJRUi0ejsYuXPxnNjvgrCiueAiEAnZYyPA3s2DtuhNG12aIM4HeXzbSNNH31nNqenuTh3as=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8177},"main":"index.js","type":"module","types":"./index.d.ts","gitHead":"7e153b4da854e40088fc09a1732ebbabbc588a9b","scripts":{"bundle":"npx tsc && npx rollup -c","localdist":"rm -f ambita-status-notification-subscriber-*.tgz && npm pack && npm i -g ambita-status-notification-subscriber-*.tgz"},"_npmUser":{"name":"ambitadrift","email":"drift@ambita.com"},"_npmVersion":"10.8.2","description":"Ambita's lightweight library designed for frontend applications to fetch and subscribe to updated notifications by subscribing to topic.","directories":{},"_nodeVersion":"20.18.0","dependencies":{"aws-iot-device-sdk-v2":"^1.21.1","@aws-sdk/util-utf8-browser":"^3.259.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.27.4","typescript":"^5.7.2","patch-package":"^8.0.0","rollup-plugin-dts":"^6.1.1","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-node-resolve":"^15.3.0"},"_npmOperationalInternal":{"tmp":"tmp/status-notification-subscriber_1.0.3_1737497037873_0.12349709808474718","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-beta.0":{"name":"@ambita/status-notification-subscriber","version":"1.1.0-beta.0","keywords":["ambita","status-notification","driftsmeldinger","aws-iot","mqtt","websocket"],"author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"license":"ISC","_id":"@ambita/status-notification-subscriber@1.1.0-beta.0","maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"homepage":"https://github.com/Ambita/status-notification-subscriber#readme","bugs":{"url":"https://github.com/Ambita/status-notification-subscriber/issues"},"dist":{"shasum":"2860786e39a8d697832161212a3d89dddf175916","tarball":"https://registry.npmjs.org/@ambita/status-notification-subscriber/-/status-notification-subscriber-1.1.0-beta.0.tgz","fileCount":4,"integrity":"sha512-I8xDDJJ4Li95cxFABKQx6XSZOcIEauc7ANNjGtX2kr2RbL1Vh1ynyw8/R/OqRE87Fa72E4fEEfqpc/sK+kpGEQ==","signatures":[{"sig":"MEUCIQDfuo8JlyK/xhsfE07rXFD3a0zPZ1mSDzzQMXktrqOBdQIgSK1w/SJb1XpXHeh81LZHmBQkl0EQFXZvdNn6dfsY2P4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11701},"main":"index.js","type":"module","types":"index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"e0497fc808034471f288800d601d85a51e7eb266","scripts":{"lint":"eslint src","build":"tsc && rollup -c","clean":"rm -rf dist","bundle":"npm run build","lint:fix":"eslint src --fix","localdist":"rm -f ambita-status-notification-subscriber-*.tgz && npm pack && npm i -g ambita-status-notification-subscriber-*.tgz","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ambitadrift","email":"drift@ambita.com"},"overrides":{"uuid":"11.1.1"},"repository":{"url":"git+https://github.com/Ambita/status-notification-subscriber.git","type":"git"},"_npmVersion":"11.12.1","description":"Ambita's lightweight frontend library for receiving real-time infrastructure status messages (\"driftsmeldinger\") over AWS IoT (MQTT via WebSocket).","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"aws-iot-device-sdk-v2":"^1.28.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^10.9.0","rollup":"^4.62.5","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.2.0","rollup-plugin-dts":"^6.5.1","typescript-eslint":"^8.67.0","@rollup/plugin-commonjs":"^29.0.3","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"tmp":"tmp/status-notification-subscriber_1.1.0-beta.0_1787644995658_0.9543363334650079","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-beta.1":{"name":"@ambita/status-notification-subscriber","version":"1.1.0-beta.1","keywords":["ambita","status-notification","driftsmeldinger","aws-iot","mqtt","websocket"],"author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"license":"ISC","_id":"@ambita/status-notification-subscriber@1.1.0-beta.1","maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"homepage":"https://github.com/Ambita/status-notification-subscriber#readme","bugs":{"url":"https://github.com/Ambita/status-notification-subscriber/issues"},"dist":{"shasum":"4641d75f71b5a35dbeac5165996cd46e42a0dda3","tarball":"https://registry.npmjs.org/@ambita/status-notification-subscriber/-/status-notification-subscriber-1.1.0-beta.1.tgz","fileCount":4,"integrity":"sha512-gaJxKttGy4pYllYfSh0nHxUfeqmC/hhUsIS7rA2+PjGC90bMLN1g2J7TnvrMIrrmWM6reGIqOas5ggzwDl5u1Q==","signatures":[{"sig":"MEYCIQDFdI85B33YCriebZTee+krLKa3SEPdSoTydL/Y/uGWxwIhAJek7PWzEFwXb1PHy/aRbkNfNGJw3MUYiRdbHEkgD+Rj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13382},"main":"index.js","type":"module","types":"index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"693e73086b79d9e215f45cdce3fc5b08674ca395","scripts":{"lint":"eslint src","build":"tsc && rollup -c","clean":"rm -rf dist","bundle":"npm run build","lint:fix":"eslint src --fix","localdist":"rm -f ambita-status-notification-subscriber-*.tgz && npm pack && npm i -g ambita-status-notification-subscriber-*.tgz","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ambitadrift","email":"drift@ambita.com"},"overrides":{"uuid":"11.1.1"},"repository":{"url":"git+https://github.com/Ambita/status-notification-subscriber.git","type":"git"},"_npmVersion":"11.12.1","description":"Ambita's lightweight frontend library for receiving real-time infrastructure status messages (\"driftsmeldinger\") over AWS IoT (MQTT via WebSocket).","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"aws-iot-device-sdk-v2":"^1.28.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^10.9.0","rollup":"^4.62.5","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.2.0","rollup-plugin-dts":"^6.5.1","typescript-eslint":"^8.67.0","@rollup/plugin-commonjs":"^29.0.3","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"tmp":"tmp/status-notification-subscriber_1.1.0-beta.1_1787651002225_0.8408579887942003","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@ambita/status-notification-subscriber","version":"1.1.0","description":"Ambita's lightweight frontend library for receiving real-time infrastructure status messages (\"driftsmeldinger\") over AWS IoT (MQTT via WebSocket).","keywords":["ambita","status-notification","driftsmeldinger","aws-iot","mqtt","websocket"],"license":"ISC","author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"repository":{"type":"git","url":"git+https://github.com/Ambita/status-notification-subscriber.git"},"homepage":"https://github.com/Ambita/status-notification-subscriber#readme","bugs":{"url":"https://github.com/Ambita/status-notification-subscriber/issues"},"type":"module","main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"sideEffects":false,"engines":{"node":">=22"},"scripts":{"build":"tsc && rollup -c","bundle":"npm run build","typecheck":"tsc --noEmit","clean":"rm -rf dist","localdist":"rm -f ambita-status-notification-subscriber-*.tgz && npm pack && npm i -g ambita-status-notification-subscriber-*.tgz","lint":"eslint src","lint:fix":"eslint src --fix"},"dependencies":{"aws-iot-device-sdk-v2":"^1.28.0"},"devDependencies":{"@eslint/js":"^10.0.1","@rollup/plugin-commonjs":"^29.0.3","@rollup/plugin-node-resolve":"^16.0.3","@types/node":"^26.2.0","eslint":"^10.9.0","rollup":"^4.62.5","rollup-plugin-dts":"^6.5.1","typescript":"^6.0.3","typescript-eslint":"^8.67.0"},"overrides":{"uuid":"11.1.1"},"gitHead":"56143fedc8ec170f14c6c8d74b253ca9aba16a2f","_id":"@ambita/status-notification-subscriber@1.1.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-crvOIjDrudVEbHhLK3KTB0iAnemevGb2QeM0/yfefl1RKYbJdEWfKlfrZ92QQTsCE7aQYVWrhKY9nIFT9vYa/A==","shasum":"f8acecce744c154426ba7dbad061ff084078b3e4","tarball":"https://registry.npmjs.org/@ambita/status-notification-subscriber/-/status-notification-subscriber-1.1.0.tgz","fileCount":4,"unpackedSize":13403,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF2HSZj+0GXwVm3HCfoUmbC7y2wkHezUGZvQO2ltZtWaAiEA8KNh8plyxqNeQCBcewZ/q/armoY2ANZXbL/nxR5POK4="}]},"_npmUser":{"name":"ambitadrift","email":"drift@ambita.com"},"directories":{},"maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/status-notification-subscriber_1.1.0_1787737435818_0.8905648671844195"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-02T12:52:08.970Z","modified":"2026-08-26T09:43:56.227Z","1.0.0":"2024-12-02T12:52:09.147Z","1.0.1":"2024-12-02T13:31:51.367Z","1.0.2":"2025-01-21T18:54:09.773Z","1.0.3":"2025-01-21T22:03:58.054Z","1.1.0-beta.0":"2026-08-25T08:03:15.793Z","1.1.0-beta.1":"2026-08-25T09:43:22.371Z","1.1.0":"2026-08-26T09:43:55.953Z"},"author":{"name":"Yuvraj Singh","email":"ysi@ambita.com"},"license":"ISC","keywords":["ambita","status-notification","driftsmeldinger","aws-iot","mqtt","websocket"],"description":"Ambita's lightweight frontend library for receiving real-time infrastructure status messages (\"driftsmeldinger\") over AWS IoT (MQTT via WebSocket).","maintainers":[{"name":"ambitadrift","email":"drift@ambita.com"}],"readme":"# Status Notification Subscriber\n\n`@ambita/status-notification-subscriber` is Ambita's lightweight frontend library for\nreceiving **real-time infrastructure status messages** (\"driftsmeldinger\"). It subscribes to\nan AWS IoT (MQTT over WebSocket) topic and emits each published message to your application,\nso you can show users a banner when a service is degraded.\n\nIt is the **subscriber** half of the status-notification system. The infrastructure (API,\nIoT topic, IAM, publisher endpoint) lives in the\n[`core-account` CDK stack](https://github.com/Ambita/core-account/blob/main/lib/statusNotification/README.md).\nMessages are published by Ambita Support via the `Driftsmeldinger` page in `ambita-support`.\n\n> **New to this?** Start with the step-by-step tutorial:\n> [Receiving infrastructure messages](https://github.com/Ambita/golden-docs/blob/main/docs/tutorials/recieving_infrastructure_messages.md)\n> (Golden Path docs).\n\n## Features\n\n- Automatically fetches temporary IoT credentials and subscribes to the notification topic.\n- Works per environment (`beta` or `prod`).\n- Returns an `EventEmitter` that emits a `notification` event for every published message.\n- Messages are **retained** on the topic — a newly-connected subscriber immediately receives\n  the current status, without waiting for the next publish.\n\n## Installation\n\n```bash\nnpm install @ambita/status-notification-subscriber\n```\n\n## Usage\n\n```typescript\nimport { subscribeToNotifications } from '@ambita/status-notification-subscriber';\n\n// env must be 'beta' or 'prod' — anything else throws.\nconst notificationReceiver = await subscribeToNotifications('beta');\n\nnotificationReceiver.on('notification', (notification) => {\n  // `notification` is the full payload for ALL apps (see Message format below).\n  const status = notification['meglerpakke'];\n  if (status) {\n    showBanner(status.message, status.type); // type is 'info' | 'error'\n  } else {\n    hideBanner(); // null means no active status for this app\n  }\n});\n```\n\n`subscribeToNotifications` is **async** and resolves once the subscription is established;\nnotifications then arrive over time via the `notification` event (it is event-driven, not a\none-shot synchronous read).\n\n## API\n\n### `subscribeToNotifications(env): Promise<EventEmitter>`\n\n| Parameter | Type     | Description                                              |\n| --------- | -------- | -------------------------------------------------------- |\n| `env`     | `string` | Environment to connect to. Must be `'beta'` or `'prod'`. |\n\nReturns a `Promise<EventEmitter>`. The emitter emits:\n\n- **`notification`** — payload: the parsed message object (see below).\n\n## Message format\n\nEvery published message is a single object containing the status for **all** applications,\nkeyed by application id. The same payload is delivered on every `notification` event (this is\nthe wire contract published by Ambita Support):\n\n```jsonc\n{\n  \"meglerpakke\": {\n    \"message\": \"Vi opplever for øyeblikket problemer med BankID\",\n    \"type\": \"error\",          // 'info' | 'error' — drives banner styling\n    \"time\": \"2026-06-23T09:12:00.000Z\"  // ISO-8601, when it was published\n  },\n  \"demo\": null                // null = no active status for this app (cleared)\n}\n```\n\n- **Keys are application ids** (e.g. `meglerpakke`, `demo`). The set of keys is whatever\n  Ambita Support currently publishes — treat it as open, and read only the key(s) your app\n  cares about.\n- A value of **`null`** means there is no active status for that app; hide your banner.\n- The status object fields are `message` (string), `type` (`'info' | 'error'`), and `time`\n  (ISO-8601 string).\n\n> The field is **`type`**, not `messageType`. (Earlier docs showed `messageType`, which does\n> not exist on the payload.)\n\n## How it works\n\n1. Fetches short-lived IoT credentials from the open subscribe endpoint\n   `GET https://s15sbtdopj.execute-api.eu-central-1.amazonaws.com/{env}/status-notification/subscribe`.\n2. Opens an MQTT-over-WebSocket connection to AWS IoT using those credentials (SigV4).\n3. Subscribes to the topic `/status-notification/{env}` and re-emits each retained/live\n   message as a `notification` event.\n\nSee the [`core-account` stack README](https://github.com/Ambita/core-account/blob/main/lib/statusNotification/README.md)\nfor the endpoints, topic, IAM roles, and the publish side.\n\n## Development\n\n```bash\nnpm install\nnpm run lint        # eslint (type-aware)\nnpm run typecheck   # tsc --noEmit\nnpm run build       # tsc -> dist/, then rollup -> index.js + index.d.ts\n```\n\nCI (`.github/workflows/ci.yml`) runs lint, typecheck and build on Node 22 and 24, and\naudits on every push and pull request.\n\n`index.js` and `index.d.ts` at the repo root are **build output, committed to the repo** —\nthey are the only files published (plus `package.json` and this README). Rebuild and commit\nthem with any `src/` change; CI fails if a fresh build does not reproduce what is committed.\n\n### Toolchain notes\n\n- **TypeScript is pinned to 6.0.3, not 7.x, deliberately.** TypeScript 7 is the Go-native\n  rewrite and ships no JavaScript compiler API, which both `rollup-plugin-dts` and\n  `typescript-eslint` need. `typescript-eslint` additionally peers on\n  `typescript >=4.8.4 <6.1.0`. TS 6.0.3 is a stable release that produces byte-identical\n  output to 7.0.2 here, so staying on 6.x costs nothing and keeps type-aware linting.\n  Revisit once `typescript-eslint` supports TS 7.\n- **The `paths` mapping in `tsconfig.json` is load-bearing.** It resolves\n  `aws-iot-device-sdk-v2` to the file `dist/browser.d.ts`, which re-exports\n  `aws-crt/dist.browser/browser` where `auth.CredentialsProvider` lives. The SDK's *native*\n  typings only expose `auth.AwsCredentialsProvider`, so removing or breaking that mapping\n  fails the build in `src/client/iot-client.ts`.\n- **`uuid` is pinned via `overrides`.** `aws-iot-device-sdk-v2` depends on `uuid@^8.3.2`,\n  which carries GHSA-w5hq-g745-h8pq. The override raises it to `11.1.1` — the lowest fixed\n  version that still ships a CommonJS build, which matters because the SDK calls\n  `require(\"uuid\")` and this package targets CommonJS-compatible consumers. Do not raise it\n  to 12+: those are ESM-only and would break `require()`. Note that npm ignores `overrides`\n  coming from a dependency, so this protects this repo and its CI, not consumers — the real\n  fix is for the SDK to widen its range upstream.\n\n### Known limitation\n\n`subscribeToNotifications` keeps its credentials and MQTT client in module-level variables,\nso calling it more than once in the same process makes the calls clobber each other. It is\ndesigned for a single subscription per application, which is how it is used today.\n\n## See also\n\n- [Tutorial: Receiving infrastructure messages](https://github.com/Ambita/golden-docs/blob/main/docs/tutorials/recieving_infrastructure_messages.md) — Golden Path step-by-step guide\n- [`core-account` StatusNotification stack](https://github.com/Ambita/core-account/blob/main/lib/statusNotification/README.md) — the infrastructure and publisher\n","readmeFilename":"README.md","homepage":"https://github.com/Ambita/status-notification-subscriber#readme","repository":{"type":"git","url":"git+https://github.com/Ambita/status-notification-subscriber.git"},"bugs":{"url":"https://github.com/Ambita/status-notification-subscriber/issues"}}