{"_id":"@arsel.sa/web-sdk","_rev":"4-c329c969c95f6932d29c679f2745019d","name":"@arsel.sa/web-sdk","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@arsel.sa/web-sdk","version":"1.0.0","keywords":["arsel","analytics","events","web-push","push-notifications","service-worker","sdk"],"author":{"url":"https://arsel.sa","name":"Arsel"},"license":"MIT","_id":"@arsel.sa/web-sdk@1.0.0","maintainers":[{"name":"arsel-sa","email":"tech@arsel.sa"}],"homepage":"https://github.com/BasicsEngage/arsel-web-sdk#readme","bugs":{"url":"https://github.com/BasicsEngage/arsel-web-sdk/issues"},"dist":{"shasum":"b0a65eb0e98f21cd349aa035c7b6992e4a1d0e41","tarball":"https://registry.npmjs.org/@arsel.sa/web-sdk/-/web-sdk-1.0.0.tgz","fileCount":17,"integrity":"sha512-4fc/XRph6X/vPvk10nYfO++qfvanW4qUb34as89JVYo+QyYIUzbXsHNA6ryPdSYoGc38j81A1P7YDLJc6W4Jfg==","signatures":[{"sig":"MEUCIHi7IiZ+C3mnyVnf/aiqTY3831budWngRhg8Emg9SqxCAiEAtLfx5pOnORqPmZQHHze0tFfnMRFNvAc4JvetwJQT0p0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arsel.sa%2fweb-sdk@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":182776},"main":"./dist/arsel.umd.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/arsel.umd.cjs","module":"./dist/arsel.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/arsel.js","require":"./dist/arsel.umd.cjs"},"./sw":"./sw/arsel-sw.js"},"gitHead":"61252d12214adfd2adc7ed5ae8f6b6cd765b7af3","scripts":{"test":"vitest run","build":"vite build && tsc","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"arsel-sa","email":"tech@arsel.sa"},"jsdelivr":"./dist/arsel.umd.cjs","repository":{"url":"git+https://github.com/BasicsEngage/arsel-web-sdk.git","type":"git"},"_npmVersion":"10.9.8","description":"Arsel web SDK — events, identity and web push.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.0","fake-indexeddb":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/web-sdk_1.0.0_1787008720731_0.23984814015935707","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@arsel.sa/web-sdk","version":"1.1.0","keywords":["arsel","analytics","events","web-push","push-notifications","service-worker","sdk"],"author":{"url":"https://arsel.sa","name":"Arsel"},"license":"MIT","_id":"@arsel.sa/web-sdk@1.1.0","maintainers":[{"name":"arsel-sa","email":"tech@arsel.sa"}],"homepage":"https://github.com/BasicsEngage/arsel-web-sdk#readme","bugs":{"url":"https://github.com/BasicsEngage/arsel-web-sdk/issues"},"dist":{"shasum":"abf20d0aabbdeed842a98c502f507984f637efce","tarball":"https://registry.npmjs.org/@arsel.sa/web-sdk/-/web-sdk-1.1.0.tgz","fileCount":19,"integrity":"sha512-7QvopHF93TlDlzqd2FrlhzuEWgT9ugooYAQgHETjMAqdoZSSGI78uoguTHrcyTr7Hbm4lLangjAJfzLxzoZmLw==","signatures":[{"sig":"MEUCIQCgzGYHVBs7M17irc+dcbscuPfoi8F/e0qOSnR9ViB8nQIgBb3ADWCh8Q9O8Abxsy4g9Akmv8MhGaTxTMKJn9Jdu2E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arsel.sa%2fweb-sdk@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":399419},"main":"./dist/arsel.umd.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/arsel.umd.cjs","module":"./dist/arsel.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/arsel.js","require":"./dist/arsel.umd.cjs"},"./sw":"./sw/arsel-sw.js"},"gitHead":"18dd108bb8a8908f26f300fae6d1a3e328ee91d1","scripts":{"test":"vitest run","build":"vite build && tsc","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a40b9ee3-ddaf-4b03-b075-6ca0ff6ea529"}},"jsdelivr":"./dist/arsel.umd.cjs","repository":{"url":"git+https://github.com/BasicsEngage/arsel-web-sdk.git","type":"git"},"_npmVersion":"12.0.2","description":"Arsel web SDK — events, identity and web push.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^2.1.8","happy-dom":"^15.11.0","typescript":"^5.7.2","@types/node":"^22.10.0","fake-indexeddb":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/web-sdk_1.1.0_1787482048433_0.9980407762816823","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@arsel.sa/web-sdk","version":"1.2.0","keywords":["arsel","analytics","events","web-push","push-notifications","service-worker","sdk"],"author":{"url":"https://arsel.sa","name":"Arsel"},"license":"MIT","_id":"@arsel.sa/web-sdk@1.2.0","maintainers":[{"name":"arsel-sa","email":"tech@arsel.sa"}],"homepage":"https://github.com/BasicsEngage/arsel-web-sdk#readme","bugs":{"url":"https://github.com/BasicsEngage/arsel-web-sdk/issues"},"dist":{"shasum":"2bfcb4d55f72f0e1cc17532e8aa5bd85b61163aa","tarball":"https://registry.npmjs.org/@arsel.sa/web-sdk/-/web-sdk-1.2.0.tgz","fileCount":20,"integrity":"sha512-WYBt8wNsjM3fGiRFWonhUK5vPVBoDGra1s8OAKZg22B8hHab68kGeif6jAn2Fptx78EceasfBIxxOgw9Bij4BQ==","signatures":[{"sig":"MEUCIQCoVWC3Zoge5us89lmm/5M3Vcu2cLqqi/fZLwe4z6XXcQIgHZJi7kJStqisSNnM0xId+BmeWL2FNketoS6KF523dK0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arsel.sa%2fweb-sdk@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":406804},"main":"./dist/arsel.umd.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/arsel.umd.cjs","module":"./dist/arsel.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/arsel.js","require":"./dist/arsel.umd.cjs"},"./sw":"./sw/arsel-sw.js"},"gitHead":"b5a96c7f8f54afb9850a7555245d8710ef05bb7b","scripts":{"test":"vitest run","build":"vite build && tsc","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a40b9ee3-ddaf-4b03-b075-6ca0ff6ea529"}},"jsdelivr":"./dist/arsel.umd.cjs","repository":{"url":"git+https://github.com/BasicsEngage/arsel-web-sdk.git","type":"git"},"_npmVersion":"12.0.2","description":"Arsel web SDK — events, identity and web push.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^2.1.8","happy-dom":"^15.11.0","typescript":"^5.7.2","@types/node":"^22.10.0","fake-indexeddb":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/web-sdk_1.2.0_1788362616079_0.019951570564623378","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@arsel.sa/web-sdk","version":"1.3.0","description":"Arsel web SDK — events, identity and web push.","license":"MIT","author":{"name":"Arsel","url":"https://arsel.sa"},"homepage":"https://github.com/Arsel-SA/arsel-web-sdk#readme","repository":{"type":"git","url":"git+https://github.com/Arsel-SA/arsel-web-sdk.git"},"bugs":{"url":"https://github.com/Arsel-SA/arsel-web-sdk/issues"},"keywords":["arsel","analytics","events","web-push","push-notifications","service-worker","sdk"],"type":"module","sideEffects":false,"publishConfig":{"access":"public"},"main":"./dist/arsel.umd.cjs","module":"./dist/arsel.js","types":"./dist/index.d.ts","unpkg":"./dist/arsel.umd.cjs","jsdelivr":"./dist/arsel.umd.cjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/arsel.js","require":"./dist/arsel.umd.cjs"},"./sw":"./sw/arsel-sw.js"},"scripts":{"build":"vite build && tsc","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"devDependencies":{"@types/node":"^22.10.0","fake-indexeddb":"^6.0.0","happy-dom":"^15.11.0","typescript":"^5.7.2","vite":"^6.0.0","vitest":"^2.1.8"},"gitHead":"84769699bd9af56bb8cd651a2c3add14587e5716","_id":"@arsel.sa/web-sdk@1.3.0","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-pCFnsGTgHpsYiGi3EQRF7+PfupBqpQFk19SDosy4OE6fH398Asw919QCtKx6JgslJ4RCTLnHjTRDkHM12tQ3Vg==","shasum":"ee594a65e88dfd5ffe39b528244131dff576e1f9","tarball":"https://registry.npmjs.org/@arsel.sa/web-sdk/-/web-sdk-1.3.0.tgz","fileCount":21,"unpackedSize":534583,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arsel.sa%2fweb-sdk@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD3VDWg5D+omahTrxE1V2VEehGci2a9kIEe3BwZdIc/IAIge5OhJ/1gADZERNe0W4K2jAeHf52aru1nqY1P2ahnOCY="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7f6c1078-338a-4172-bc86-20f9dc0c7f41"}},"directories":{},"maintainers":[{"name":"arsel-sa","email":"tech@arsel.sa"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/web-sdk_1.3.0_1788895448993_0.2476923008619154"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T23:18:40.611Z","modified":"2026-09-08T19:24:09.505Z","1.0.0":"2026-08-17T23:18:40.907Z","1.1.0":"2026-08-23T10:47:28.568Z","1.2.0":"2026-09-02T15:23:36.230Z","1.3.0":"2026-09-08T19:24:09.189Z"},"bugs":{"url":"https://github.com/Arsel-SA/arsel-web-sdk/issues"},"author":{"name":"Arsel","url":"https://arsel.sa"},"license":"MIT","homepage":"https://github.com/Arsel-SA/arsel-web-sdk#readme","keywords":["arsel","analytics","events","web-push","push-notifications","service-worker","sdk"],"repository":{"type":"git","url":"git+https://github.com/Arsel-SA/arsel-web-sdk.git"},"description":"Arsel web SDK — events, identity and web push.","maintainers":[{"name":"arsel-sa","email":"tech@arsel.sa"}],"readme":"# Arsel Web SDK\n\nEvents, identity and web push for the browser. ~4 kB gzipped, no dependencies, ESM + UMD.\n\n```js\nimport Arsel from '@arsel.sa/web-sdk';\n\nawait Arsel.init({ clientKey: 'pub_…', baseUrl: 'https://api.arsel.sa' });\n\nArsel.track('product.viewed', { sku: 'A-1023', price: 149.99 });\nArsel.identify({ externalId: user.id });\n```\n\n**Two channels, and only one of them needs push.** `track()` and `identify()` work with notifications\ndenied, blocked, or never asked for — a visitor who declines still has a contact and a behavioural\nhistory. Only delivery needs a subscription. Nothing in the events API waits on the push API.\n\n---\n\n## Documentation\n\n| | |\n| --- | --- |\n| **[Quickstart](docs/quickstart.md)** | Install, initialize, and verify in about ten minutes. |\n| **[Identity](docs/identity.md)** | Anonymous → identified, the identifier ladder, merges, `reset()`. |\n| **[Events](docs/events.md)** | Custom events, properties, limits, reserved events, sessions, durability. |\n| **[Web push](docs/web-push.md)** | Service worker, VAPID, permission UX, browser support, engagements. |\n| **[API reference](docs/api-reference.md)** | Every method: signature, arguments, returns, when to call it. |\n| **[Troubleshooting](docs/troubleshooting.md)** | Symptom → cause → fix, and the things that only look like bugs. |\n| **[Data collection](docs/data-collection.md)** | What the SDK stores and sends, and what it never does. GDPR/erasure. |\n| **[Migrating from CleverTap](docs/migrating-from-clevertap.md)** | API mapping, identity mapping, and the traps. |\n| **[Changelog](CHANGELOG.md)** | Release notes. |\n\n## Requirements\n\n| | |\n| --- | --- |\n| Browsers | Chrome/Edge 79+, Firefox 72+, Safari 16.4+, and their mobile equivalents |\n| Transport | Your **page** must be served over HTTPS for push (`http://localhost` is the browser's one exemption). The **API `baseUrl`** must be HTTPS too, except `http://localhost` / `http://127.0.0.1` for a local backend. |\n| Bundlers | Any, or none — the UMD build works from a script tag |\n| Runtime deps | None |\n\nPush has a narrower support surface than events; see the matrix in\n[docs/web-push.md](docs/web-push.md#browser-support).\n\n## Install\n\n```bash\nnpm install @arsel.sa/web-sdk\n```\n\nOr from a script tag, which exposes the same surface on `window.Arsel`. unpkg and jsDelivr serve the\nUMD build straight from npm — **pin the version**, and add an\n[SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) hash so a\ncompromised CDN cannot run arbitrary script on your pages:\n\n```html\n<script src=\"https://unpkg.com/@arsel.sa/web-sdk@1.3.0/dist/arsel.umd.cjs\"\n        integrity=\"sha384-…\" crossorigin=\"anonymous\"></script>\n<script>Arsel.init({ clientKey: 'pub_…', baseUrl: 'https://api.arsel.sa' })</script>\n```\n\nOr skip the third party altogether: copy `node_modules/@arsel.sa/web-sdk/dist/arsel.umd.cjs` into your\nstatic assets and serve it from your own origin.\n\nFor push, also add **one file** to your site — see\n[the service worker](docs/quickstart.md#3-add-the-service-worker).\n\n## `clientKey` is publishable, and that is the design\n\nIt authenticates the event and push channels and grants nothing else — no reads, no contact list, none\nof what a secret API key can do. Every vendor in this category does the same: Klaviyo's site ID,\nCleverTap's Account ID, Braze's SDK key, Mixpanel's project token.\n\n**Never put a secret API key in page source.** The residual risk on a publishable key is data\n*integrity*, not confidentiality: someone who lifts it could post junk events. Origin allowlisting on\nyour org is what bounds that — a browser cannot forge its `Origin` header.\n\n## Contributing\n\n```bash\nnpm install\nnpm run typecheck        # tsc --noEmit — the gate; there is no lint step\nnpm test                 # Vitest\nnpm run build            # dist/arsel.js (ESM) + dist/arsel.umd.cjs\n```\n\n## License\n\nMIT.\n","readmeFilename":"README.md"}