{"_id":"@adr-center/pulse-support","_rev":"2-bf5ed664f0b85450de967d1c24299609","name":"@adr-center/pulse-support","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@adr-center/pulse-support","version":"0.2.0","license":"UNLICENSED","_id":"@adr-center/pulse-support@0.2.0","maintainers":[{"name":"mlorenzutti","email":"mattia.lorenzutti@gmail.com"}],"homepage":"https://github.com/ods-adr-center/pulse#readme","bugs":{"url":"https://github.com/ods-adr-center/pulse/issues"},"dist":{"shasum":"954ec88e4377d50aab5589f4ed87837e1694417c","tarball":"https://registry.npmjs.org/@adr-center/pulse-support/-/pulse-support-0.2.0.tgz","fileCount":6,"integrity":"sha512-mi1BlsoomP++vIMgn0h0E86FWZplS6CEjZAkUtFULnYdpXPBKvio8EJPUu77Uc9fBJy6vqRb5otCGqIx5a8zrg==","signatures":[{"sig":"MEUCIQDM/ZW5ADJgtT3rD9LgB4IPpaLoUJyhSWo46/xQtMYtcwIgUJFB93bJvqJ4fbYgDgKGAb/B8w4fEVr52FzB8eWByZg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22300},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"}},"gitHead":"830eadaa0eab5db6c319ceb8414388aaef3e8ba6","scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"_npmUser":{"name":"mlorenzutti","email":"mattia.lorenzutti@gmail.com"},"repository":{"url":"git+https://github.com/ods-adr-center/pulse.git","type":"git","directory":"packages/support-sdk"},"_npmVersion":"10.8.2","description":"ADR Pulse support reporting SDK and embeddable widget","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/react":"^19.2.14"},"peerDependencies":{"react":">=18"},"_npmOperationalInternal":{"tmp":"tmp/pulse-support_0.2.0_1786965862264_0.5828947378980001","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@adr-center/pulse-support","version":"0.2.1","description":"ADR Pulse support reporting SDK and embeddable widget","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"}},"scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/ods-adr-center/pulse.git","directory":"packages/support-sdk"},"homepage":"https://github.com/ods-adr-center/pulse#readme","peerDependencies":{"react":">=18"},"devDependencies":{"@types/react":"^19.2.14","typescript":"^5.9.3"},"license":"UNLICENSED","publishConfig":{"access":"public"},"_id":"@adr-center/pulse-support@0.2.1","gitHead":"830eadaa0eab5db6c319ceb8414388aaef3e8ba6","bugs":{"url":"https://github.com/ods-adr-center/pulse/issues"},"_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-yK2VOVz5p8b7PTA2EWKgBEwFRlNaIe4+GNkRvVWZXnuld20fPxCoMBPBJ/w9l+nNk+lQuy9DvhEu4mM4C0oH+w==","shasum":"6117c4ca2b9982711138f832b48b0e4a4be31463","tarball":"https://registry.npmjs.org/@adr-center/pulse-support/-/pulse-support-0.2.1.tgz","fileCount":6,"unpackedSize":22306,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBw8Fy66xUl6vGiLawXtOW4CBCz/RsMcrWt2ImzOchvqAiBKAFwZDB1qEP8r7xfMhB/uQdSCxS5YlLJl73n9dFIBYg=="}]},"_npmUser":{"name":"mlorenzutti","email":"mattia.lorenzutti@gmail.com"},"directories":{},"maintainers":[{"name":"mlorenzutti","email":"mattia.lorenzutti@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pulse-support_0.2.1_1786966565725_0.269121175713239"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T11:24:22.048Z","modified":"2026-08-17T11:36:09.517Z","0.2.0":"2026-08-17T11:24:22.406Z","0.2.1":"2026-08-17T11:36:05.870Z"},"bugs":{"url":"https://github.com/ods-adr-center/pulse/issues"},"license":"UNLICENSED","homepage":"https://github.com/ods-adr-center/pulse#readme","repository":{"type":"git","url":"git+https://github.com/ods-adr-center/pulse.git","directory":"packages/support-sdk"},"description":"ADR Pulse support reporting SDK and embeddable widget","maintainers":[{"name":"mlorenzutti","email":"mattia.lorenzutti@gmail.com"}],"readme":"# ADR Pulse Support SDK\n\nInstall the public package and initialize it once in the host application:\n\n```bash\nnpm install @adr-center/pulse-support\n```\n\n```ts\nimport { PulseSupport } from \"@adr-center/pulse-support\";\n\nPulseSupport.init({\n  apiUrl: \"https://adr-pulse-52uewqsrka-ey.a.run.app\",\n  productKey: \"ods-hub\",\n  environment: \"production\",\n  appVersion: \"2.6.0\",\n  getAuthToken: () => firebaseUser.getIdToken(),\n}).installButton();\n```\n\nFor a public or server-rendered application, its backend exchanges the private\nintegration key for a short-lived reporter token at `POST /api/v1/support/token`.\nThe integration key must never be included in browser code.\n\nThe same client can open the dialog from an existing application button:\n\n```ts\nconst support = PulseSupport.init(config);\ndocument.querySelector(\"#report-problem\")?.addEventListener(\"click\", () => {\n  support.open({ type: \"bug\" });\n});\n```\n\nReact applications can import `PulseSupportButton` from\n`@adr-center/pulse-support/react`. The returned report reference and\nper-report status token are saved in local storage so the application can call\n`client.getReport(reference)` without exposing internal notes.\n\n## Show a person's requests\n\n`listReports()` uses the current Firebase or short-lived reporter token and\nreturns only requests created by that reporter for the configured product.\nUse `status: \"open\"` for a compact \"My open requests\" screen:\n\n```ts\nconst openRequests = await support.listReports({ status: \"open\" });\n```\n\nWhen the support team asks for more information, the reporter can answer from\nthe connected product. A request in `waiting` returns to `investigating` after\nthe reply is accepted:\n\n```ts\nawait support.reply(reportId, \"The problem also happens in a private window.\");\n```\n\n## Notify when something changes\n\nThe watcher polls no more often than every 15 seconds and invokes the callback\nonly after a known request changes. The host product remains in control of the\nnotification UI:\n\n```ts\nconst stopWatching = support.watchReports({\n  intervalMs: 60_000,\n  onChange: (report, previous) => {\n    if (report.status === \"resolved\" && previous?.status !== \"resolved\") {\n      showToast(`${report.title} has been resolved`);\n    } else {\n      showToast(`New support update: ${report.title}`);\n    }\n  },\n});\n\n// Call when the signed-in session or application is disposed.\nstopWatching();\n```\n\nReporter-visible updates are deliberately separate from internal investigation\nnotes. The SDK never returns internal notes, diagnostics, ownership, or other\npeople's requests.\n\nThe widget collects only the report text, optional files, and safe application\ncontext. Browser diagnostics are included only after the reporter selects the\nconsent checkbox. Form values, credentials, tokens, and case content are never\ncollected automatically.\n","readmeFilename":"README.md"}