{"_id":"@authx-rs/sdk-web","name":"@authx-rs/sdk-web","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@authx-rs/sdk-web","version":"0.1.0","description":"Browser token storage and refresh orchestration for authx-rs","type":"module","sideEffects":false,"main":"./dist/esm/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","default":"./dist/esm/index.js"}},"scripts":{"build":"node ./scripts/build.mjs","pretest":"npm run build","test":"node --test ./test/*.test.mjs","prepack":"npm run build && npm test","pack:check":"npm pack --dry-run --cache /tmp/authx-npm-cache"},"engines":{"node":">=18","npm":">=9"},"publishConfig":{"access":"public"},"keywords":["authx","oauth2","oidc","token","typescript"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/hamzzy/authx-rs.git","directory":"packages/authx-sdk-web"},"homepage":"https://github.com/hamzzy/authx-rs","bugs":{"url":"https://github.com/hamzzy/authx-rs/issues"},"devDependencies":{"typescript":"^5.9.3"},"_id":"@authx-rs/sdk-web@0.1.0","gitHead":"076e62c44b8403974ec8ad65579f05e44456516d","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-9aIhEogyX7TdMM1xcBKEVM5X0ZneHLa6MqcQispzWoiBn8OggBsCc7YTVFPMuGrKgKfqhqZfhW1TJFJKi09jKg==","shasum":"8b1b68d1a8715f6af2c6e64995967ac7ebe37de1","tarball":"https://registry.npmjs.org/@authx-rs/sdk-web/-/sdk-web-0.1.0.tgz","fileCount":12,"unpackedSize":16946,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@authx-rs%2fsdk-web@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCsZOrWQRh5U6pB7wgrDEUw6Rri+2QcadAQuXkQ4whvcQIgaXOfZ/k0awzpfL92BfqIOXOs8iXQxtEB93gBkrx6NrU="}]},"_npmUser":{"name":"hamzzygeek","email":"hamat.ibrahim3@gmail.com"},"directories":{},"maintainers":[{"name":"hamzzygeek","email":"hamat.ibrahim3@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-web_0.1.0_1772793133628_0.176073541142864"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-06T10:32:13.526Z","0.1.0":"2026-03-06T10:32:13.777Z","modified":"2026-03-06T10:32:14.192Z"},"maintainers":[{"name":"hamzzygeek","email":"hamat.ibrahim3@gmail.com"}],"description":"Browser token storage and refresh orchestration for authx-rs","homepage":"https://github.com/hamzzy/authx-rs","keywords":["authx","oauth2","oidc","token","typescript"],"repository":{"type":"git","url":"git+https://github.com/hamzzy/authx-rs.git","directory":"packages/authx-sdk-web"},"bugs":{"url":"https://github.com/hamzzy/authx-rs/issues"},"license":"MIT","readme":"# @authx-rs/sdk-web\n\nHigher-level browser helpers for `authx-rs` token-based clients.\n\nCurrent scope:\n\n- token persistence with pluggable storage\n- access token expiry tracking\n- single-flight refresh orchestration\n- authenticated `fetch()` wrapper with optional 401 retry\n- OIDC refresh handler for standard token endpoints\n\nThe package is ESM-only and targets modern runtimes with `fetch`, `URL`, and timers.\n\n## Example\n\n```ts\nimport {\n  AuthxTokenManager,\n  BrowserStorageTokenStore,\n  createOidcTokenRefresher,\n} from \"@authx-rs/sdk-web\";\n\nconst client = new AuthxTokenManager({\n  storage: new BrowserStorageTokenStore(),\n  refresh: createOidcTokenRefresher({\n    tokenEndpoint: \"https://auth.example.com/oidc/token\",\n    clientId: \"spa-client\",\n  }),\n});\n\nawait client.start();\nawait client.setTokenResponse({\n  access_token: \"access-token\",\n  token_type: \"Bearer\",\n  expires_in: 3600,\n  refresh_token: \"refresh-token\",\n});\n\nconst response = await client.fetch(\"https://api.example.com/me\");\n```\n","readmeFilename":"README.md","_rev":"1-664d538b16fcab7d33dbd6b6b14ec25c"}