{"_id":"@1sygnal/onesygnal-web-sdk","_rev":"3-ecd568ea99f2f7966c3d9792fa6095a2","name":"@1sygnal/onesygnal-web-sdk","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@1sygnal/onesygnal-web-sdk","version":"1.0.0","keywords":["surveys","feedback","analytics","1sygnal"],"author":{"name":"1Sygnal"},"license":"MIT","_id":"@1sygnal/onesygnal-web-sdk@1.0.0","maintainers":[{"name":"onesygnal","email":"platform@1sygnal.app"}],"homepage":"https://github.com/1Sygnal/1sygnal-web#readme","bugs":{"url":"https://github.com/1Sygnal/1sygnal-web/issues"},"dist":{"shasum":"a83551701b096ff0668fb41144db84764b82525c","tarball":"https://registry.npmjs.org/@1sygnal/onesygnal-web-sdk/-/onesygnal-web-sdk-1.0.0.tgz","fileCount":6,"integrity":"sha512-QvqZcwV+Z2VSLgpEdb338+hKwuBPoDfdXHbbqRptklbiMnjXctsnbwdrQZ1JKYiuHiRzZiNTBw0t5Yj+R6RJTA==","signatures":[{"sig":"MEUCIEDcb1M0IfaXTRlTHPKJyTQUEsMNkh6Ane43dBDgrvt3AiEAjYzZPQJPHLCpLy5+CLhkUJMNw1NaIDRDOQjdazH2UOw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16294},"main":"index.cjs","type":"module","types":"index.d.ts","module":"index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.cjs"}},"gitHead":"4b7cca0928d4a88de7ddf1182c1120e17203e385","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"onesygnal","email":"platform@1sygnal.app"},"repository":{"url":"git+https://github.com/1Sygnal/1sygnal-web.git","type":"git"},"_npmVersion":"11.7.0","description":"1Sygnal Web SDK — thin loader + CDN-hosted survey engine","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/onesygnal-web-sdk_1.0.0_1787240004415_0.07533249443971157","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@1sygnal/onesygnal-web-sdk","version":"1.0.1","keywords":["surveys","feedback","analytics","1sygnal"],"license":"MIT","_id":"@1sygnal/onesygnal-web-sdk@1.0.1","maintainers":[{"name":"onesygnal","email":"platform@1sygnal.app"}],"homepage":"https://github.com/1Sygnal/1sygnal-web#readme","bugs":{"url":"https://github.com/1Sygnal/1sygnal-web/issues"},"dist":{"shasum":"b5860f408658ab4878a2c335db06ce80a0b68e0b","tarball":"https://registry.npmjs.org/@1sygnal/onesygnal-web-sdk/-/onesygnal-web-sdk-1.0.1.tgz","fileCount":6,"integrity":"sha512-4r/0mtVoRRX0Ga8Oj3k3oqlity0nP7RjNZYgLPoFtlXIPvATpq619tX0UWX1DqSNd0ZKLZga3ARYMJsLcb6Igg==","signatures":[{"sig":"MEUCIQDF7vy8lKLaqReCacoALSZC+Wjar9JkovsV64SL2v4EQAIgaV3PyHDTTISm4v7tiKfz2lXpPnfz1Bve9elSVXapW+8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@1sygnal%2fonesygnal-web-sdk@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16211},"main":"index.cjs","type":"module","types":"index.d.ts","module":"index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.cjs"}},"gitHead":"cb2816f80e4c3cef91eb0a49fb19252002bad49f","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8f14a011-8da6-4b48-8063-634510cf33e4"}},"repository":{"url":"git+https://github.com/1Sygnal/1sygnal-web.git","type":"git"},"_npmVersion":"11.17.0","description":"1Sygnal Web SDK — thin loader + CDN-hosted survey engine","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/onesygnal-web-sdk_1.0.1_1787564988400_0.9998058182972185","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"_id":"@1sygnal/onesygnal-web-sdk@1.0.3","bugs":{"url":"https://github.com/1Sygnal/1sygnal-web/issues"},"dist":{"shasum":"e54fee8fd2f25c67ed4a9b81d75c493be6417704","tarball":"https://registry.npmjs.org/@1sygnal/onesygnal-web-sdk/-/onesygnal-web-sdk-1.0.3.tgz","fileCount":6,"integrity":"sha512-nzmELLuHqqUt4rWxEDVnBUoHQDLsppZkfDNBFVTR5QucbxfEhkICkVsZtM+7t/Fa7BeZngxJ1KdGRrmv0A9uWg==","signatures":[{"sig":"MEUCIQDEdCGGVdHiaBYMolF50KqcrPrEreQmDUYxgZuzHYYThwIgA+ye6swp3PxnWgMc6aMpKpV3y77nR/cAgQ9Tqus42a8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDvVy6zqHvztIHAuJ/oQtAQK7a257ivVc3UYgxwi26iGwIgXlB6DLNXso776bsggSpMUVSOnXRhPdNUAm8+301Pu3A="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@1sygnal%2fonesygnal-web-sdk@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16489},"main":"index.cjs","name":"@1sygnal/onesygnal-web-sdk","type":"module","types":"index.d.ts","module":"index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.cjs"}},"gitHead":"61f207bb744a1ad1e7f73aafa6a01fe40c603aff","license":"MIT","version":"1.0.3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8f14a011-8da6-4b48-8063-634510cf33e4"}},"homepage":"https://github.com/1Sygnal/1sygnal-web#readme","keywords":["surveys","feedback","analytics","1sygnal"],"repository":{"url":"git+https://github.com/1Sygnal/1sygnal-web.git","type":"git"},"_npmVersion":"11.19.0","description":"1Sygnal Web SDK — thin loader + CDN-hosted survey engine","directories":{},"maintainers":[{"name":"onesygnal","email":"platform@1sygnal.app"}],"sideEffects":false,"_nodeVersion":"24.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/onesygnal-web-sdk_1.0.3_1789702120563_0.2917719058709627"}}},"time":{"created":"2026-08-20T15:33:24.293Z","modified":"2026-09-18T03:28:41.033Z","1.0.0":"2026-08-20T15:33:24.556Z","1.0.1":"2026-08-24T09:49:48.535Z","1.0.3":"2026-09-18T03:28:40.668Z"},"bugs":{"url":"https://github.com/1Sygnal/1sygnal-web/issues"},"license":"MIT","homepage":"https://github.com/1Sygnal/1sygnal-web#readme","keywords":["surveys","feedback","analytics","1sygnal"],"repository":{"url":"git+https://github.com/1Sygnal/1sygnal-web.git","type":"git"},"description":"1Sygnal Web SDK — thin loader + CDN-hosted survey engine","maintainers":[{"name":"onesygnal","email":"platform@1sygnal.app"}],"readme":"# 1Sygnal Web SDK\n\nThin loader + CDN-hosted survey engine for 1Sygnal in-product surveys, event tracking, and\nuser identification.\n\n## Installation\n\n### npm\n\n```bash\nnpm install @1sygnal/onesygnal-web-sdk\n```\n\n```typescript\nimport oneSygnal from '@1sygnal/onesygnal-web-sdk';\n\noneSygnal.init('your-api-key', { apiUrl: 'https://sdk-api.1sygnal.app' });\n```\n\nThe package has a **default export only** — there's no `{ init, track, identify }` named\nexport.\n\n### Script tag (auto-init)\n\n```html\n<script\n  src=\"https://repo.1sygnal.app/js/1sygnal.js\"\n  data-api-key=\"your-api-key\"\n  data-api-url=\"https://sdk-api.1sygnal.app\"\n></script>\n```\n\n## Usage\n\n### Tracking events\n\n```typescript\noneSygnal.track('button_click', { id: 'cta' });\n```\n\n### Identifying users\n\n```typescript\noneSygnal.identify('user-123', { plan: 'pro' });\n```\n\nAlso available: `oneSygnal.logout()` to clear session/user state, and\n`oneSygnal.setSurveysEnabled(enabled)` to toggle surveys at runtime.\n\n### Listening for survey events\n\n```typescript\noneSygnal.on('survey:completed', (event) => {\n  // handle completion\n});\n```\n\nOther available events: `\"survey:shown\"`, `\"survey:step\"`, `\"survey:dismissed\"`. Unsubscribe\nwith `oneSygnal.off(event, callback)`.\n\n## How it works\n\n`init()` returns `void`, not a Promise — it injects a `<script>` tag that loads the full SDK\nbundle from 1Sygnal's CDN, and queues `track`/`identify`/`on`/etc. calls until that bundle\nloads and signals readiness. There's nothing to `await`; calls made before the bundle is ready\nare queued and replayed once it is. This lets survey-triggering fixes and features ship to\nevery embedded site immediately, without a dependency bump and redeploy.\n\n### Mobile safe-area insets\n\nBottom/top-anchored surveys use `env(safe-area-inset-*)` to clear notches and the home\nindicator on phones. Those `env()` values only resolve once the page opts in via:\n\n```html\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n```\n\n`init()` patches this in automatically (appending `viewport-fit=cover` to an existing\n`<meta name=\"viewport\">`, or adding one if the page has none), so this is a fallback, not a\nhard requirement — but setting it yourself in the page `<head>` is still recommended, since it\ntakes effect before the SDK loads.\n\n## Docs\n\nFull integration guide: https://docs.1sygnal.app\n\n## Other SDKs\n\n- [iOS SDK](https://github.com/1Sygnal/1sygnal-ios-sdk)\n- [Android SDK](https://github.com/1Sygnal/1sygnal-android-sdk)\n","readmeFilename":"README.md"}