{"_id":"@5arz/sdk","name":"@5arz/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@5arz/sdk","version":"0.1.0","description":"Thin, zero-dependency client for the 5arz Proof-of-Human verification + payout API. Verify a real human performed an action and get a signed, JWKS-verifiable credential. Works in browsers and Node 18+.","type":"module","main":"./sarz.js","module":"./sarz.js","types":"./sarz.d.ts","exports":{".":{"types":"./sarz.d.ts","import":"./sarz.js","default":"./sarz.js"}},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"node --check sarz.js && echo ok"},"keywords":["5arz","proof-of-human","human-verification","pohf","personhood","verified-human-traffic","agentic-commerce","jwks","es256","jwt","verifiable-credential"],"homepage":"https://5arz.com/docs","repository":{"type":"git","url":"git+https://github.com/LumiRx/5arz.git","directory":"sdk"},"bugs":{"url":"https://5arz.com/support","email":"info@5arz.com"},"author":{"name":"5arz, Inc.","email":"info@5arz.com","url":"https://5arz.com"},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"79465f23eccc71d14e1300be66fd89eea0f9b82d","_id":"@5arz/sdk@0.1.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-YIQMLyznuYncHyktc9h6Sxf0fiq/1Ecxs7RckpXR4di+dglyk6chsV+TgOLVUbfsUVl6GwxxBJRnwI4jnk20VA==","shasum":"d644aea8d059388f2b51c986793826f4fc1eb418","tarball":"https://registry.npmjs.org/@5arz/sdk/-/sdk-0.1.0.tgz","fileCount":5,"unpackedSize":17684,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCKygGVF9ezOPLdrtvjRzASNaNtALSA6nt8lBwmjwjP2AIhAPESiGoQTUHp1paBCnTAXkEnQxBK9ntHWwD/525TLAJ/"}]},"_npmUser":{"name":"5arz","email":"Andre@thatislumi.com"},"directories":{},"maintainers":[{"name":"5arz","email":"Andre@thatislumi.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1782590771628_0.5390139864554713"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-27T20:06:11.405Z","0.1.0":"2026-06-27T20:06:11.755Z","modified":"2026-06-27T20:06:12.003Z"},"maintainers":[{"name":"5arz","email":"Andre@thatislumi.com"}],"description":"Thin, zero-dependency client for the 5arz Proof-of-Human verification + payout API. Verify a real human performed an action and get a signed, JWKS-verifiable credential. Works in browsers and Node 18+.","homepage":"https://5arz.com/docs","keywords":["5arz","proof-of-human","human-verification","pohf","personhood","verified-human-traffic","agentic-commerce","jwks","es256","jwt","verifiable-credential"],"repository":{"type":"git","url":"git+https://github.com/LumiRx/5arz.git","directory":"sdk"},"author":{"name":"5arz, Inc.","email":"info@5arz.com","url":"https://5arz.com"},"bugs":{"url":"https://5arz.com/support","email":"info@5arz.com"},"license":"MIT","readme":"# 5arz JavaScript SDK\n\nA thin, zero-dependency client for the 5arz verification + payout API. Works in **browsers** and **Node 18+** (uses global `fetch` + WebCrypto). One file: `sarz.js`.\n\n> Integration is three steps, then one call per event. Auth is a single Bearer key.\n\n## Install\nToday: copy `sarz.js` into your project and `import { Sarz } from \"./sarz.js\"`.\nComing: `npm i @5arz/sdk` (publish step in the onboarding kit).\n\n## Quickstart\n```js\nimport { Sarz } from \"./sarz.js\";\n\n// 1) Sign up once → get your API key (store it; shown once)\nconst { apiKey } = await Sarz.register({ name: \"MonaMedia\", contactEmail: \"you@monamedia.mc\" });\n\nconst sarz = new Sarz({ apiKey });\n\n// 2) Buy credits → open the returned Stripe checkout\nconst { checkoutUrl } = await sarz.credits.buy(\"starter\");      // starter | growth | scale\n// … user pays … then:\nconst { balance } = await sarz.credits.balance();\n\n// 3) Verify an event → get a signed credential (spends 1 credit)\nconst { pohf_jwt } = await sarz.verify(sessionId);\n```\n\n## Verify by type\n```js\nawait sarz.verify(sessionId);                 // attention / work\nawait sarz.verifyPersonhood(memberId);        // real, unique, live human\nawait sarz.submitPhysical({                    // physical presence (receipt / on-site)\n  memberId, source: \"receipt\", lat, lng, photoHash\n});\n```\n\n## Capture helpers (browser)\n```js\nconst { lat, lng, accuracy } = await Sarz.captureGeo();        // one GPS reading\nconst photoHash = await Sarz.hashPhoto(fileInput.files[0]);     // SHA-256 of a receipt photo\nawait sarz.submitPhysical({ memberId, source: \"receipt\", lat, lng, gpsAccuracyM: accuracy, photoHash, capturedAt: Date.now() });\n```\n\n## Advertiser-side verification (no API key)\nYour advertisers verify a credential themselves against the public JWKS:\n```js\nconst { valid, payload } = await Sarz.verifyCredential(pohf_jwt);\n// valid === true means: signature checks out, issuer is 5arz, not expired.\n```\n\n## A MonaMedia watch, end to end\n```js\n// after the viewer watches 10s and confirms, with your attention signals collected:\nconst sarz = new Sarz({ apiKey });\nconst { pohf_jwt } = await sarz.verify(viewSessionId, {\n  taskType: \"impression\",          // optional label\n});\n// attach pohf_jwt to the impression record; your advertiser runs:\n// Sarz.verifyCredential(pohf_jwt) → provable, no 5arz software.\n```\n\n## Notes\n- **Errors** throw with `.status` and `.body` (e.g. `402` = no credits → buy a pack).\n- **Credits** are prepaid; `verify*` and `submitPhysical` each spend one.\n- **Base URL** defaults to `https://api.5arz.com`; override with `new Sarz({ apiKey, baseUrl })` for a sandbox.\n- **React Native**: the network calls work; supply `photoHash`/`lat`/`lng` from your own capture (the DOM helpers are browser-only).\n","readmeFilename":"README.md","_rev":"1-024c7824a7049088e593c9b49322d771"}