{"_id":"@0xkey-io/sdk-browser","_rev":"4-2dc1ee46494cf731aacb95a84200baac","name":"@0xkey-io/sdk-browser","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@0xkey-io/sdk-browser","version":"0.1.0","keywords":["0xkey"],"author":{"url":"https://0xkey.com","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/sdk-browser@0.1.0","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/sdk-browser","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"0ecd2603a0eb4ee60eae281485823b369987cf3b","tarball":"https://registry.npmjs.org/@0xkey-io/sdk-browser/-/sdk-browser-0.1.0.tgz","fileCount":82,"integrity":"sha512-KZGMzeoJwfozhMBVzzFMbUaJYqC1Bl5iji/5Wym+CrCgTNwhOF2mcLg7rX2b1xGufpNvMjdfozFBd+sarCtwyQ==","signatures":[{"sig":"MEQCIA9Dj6flLIDwyebSwl1ztH1QIzO9vo1a140C54AAc6bhAiAlmiQKFE2hL721l3ldYgTOOC003SuPNjz/qPbvTrkNew==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1481011},"main":"./dist/index.js","_from":"file:0xkey-io-sdk-browser-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"rollup -c","clean":"rimraf ./dist ./.cache","codegen":"node scripts/codegen.js","version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/__generated__/version.ts","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/private/var/folders/lf/b69416ms3zvccf0ght6bq02r0000gn/T/6342b180f81bed6777d9d7145a222e3d/0xkey-io-sdk-browser-0.1.0.tgz","_integrity":"sha512-KZGMzeoJwfozhMBVzzFMbUaJYqC1Bl5iji/5Wym+CrCgTNwhOF2mcLg7rX2b1xGufpNvMjdfozFBd+sarCtwyQ==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/sdk-browser"},"_npmVersion":"11.4.2","description":"JavaScript Browser SDK","directories":{},"_nodeVersion":"24.3.0","dependencies":{"buffer":"^6.0.3","hpke-js":"^1.6.5","cross-fetch":"^3.1.5","@0xkey-io/http":"0.1.0","@0xkey-io/crypto":"0.1.0","@0xkey-io/encoding":"0.1.0","@0xkey-io/sdk-types":"0.1.0","@0xkey-io/iframe-stamper":"0.1.0","@0xkey-io/wallet-stamper":"0.1.0","@0xkey-io/api-key-stamper":"0.1.0","@0xkey-io/webauthn-stamper":"0.1.0","@0xkey-io/indexed-db-stamper":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^8.0.3","typescript":"5.4.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk-browser_0.1.0_1779443555606_0.24346981155764813","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@0xkey-io/sdk-browser","version":"0.1.1","keywords":["0xkey"],"author":{"url":"https://0xkey.com","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/sdk-browser@0.1.1","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/sdk-browser","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"68eaa65ebdd27906f0fdfa66337d4b327e6f77b9","tarball":"https://registry.npmjs.org/@0xkey-io/sdk-browser/-/sdk-browser-0.1.1.tgz","fileCount":82,"integrity":"sha512-Te+3g1EcdbzSD/wbQ2pOaXJYyQeyAcp9+xq+Y+uxPCtBRtCnWt/zcEUjGs02XKcBHxXd1D4vgW5IVhb3o40vbw==","signatures":[{"sig":"MEUCIQCp06Mkk2VzriXPzJkFOIoq2UNkpKIoPtcwcF6MOVA0CgIgdkqgVgvFaO9T8NYXBHwp0Nhgpy84L84F/lkhRV0RR+0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1481259},"main":"./dist/index.js","_from":"file:0xkey-io-sdk-browser-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"rollup -c","clean":"rimraf ./dist ./.cache","codegen":"node scripts/codegen.js","version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/__generated__/version.ts","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/private/var/folders/lf/b69416ms3zvccf0ght6bq02r0000gn/T/35b90a2a0d6894c6e573f084227fbd19/0xkey-io-sdk-browser-0.1.1.tgz","_integrity":"sha512-Te+3g1EcdbzSD/wbQ2pOaXJYyQeyAcp9+xq+Y+uxPCtBRtCnWt/zcEUjGs02XKcBHxXd1D4vgW5IVhb3o40vbw==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/sdk-browser"},"_npmVersion":"11.4.2","description":"JavaScript Browser SDK","directories":{},"_nodeVersion":"24.3.0","dependencies":{"buffer":"^6.0.3","hpke-js":"^1.6.5","cross-fetch":"^3.1.5","@0xkey-io/http":"0.1.1","@0xkey-io/crypto":"0.1.1","@0xkey-io/encoding":"0.1.1","@0xkey-io/sdk-types":"0.1.0","@0xkey-io/iframe-stamper":"0.1.0","@0xkey-io/wallet-stamper":"0.1.1","@0xkey-io/api-key-stamper":"0.1.1","@0xkey-io/webauthn-stamper":"0.1.0","@0xkey-io/indexed-db-stamper":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^8.0.3","typescript":"5.4.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk-browser_0.1.1_1779452015995_0.7492692966482708","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@0xkey-io/sdk-browser","version":"0.1.2","keywords":["0xkey"],"author":{"url":"https://0xkey.com","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/sdk-browser@0.1.2","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/sdk-browser","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"1810648c3e356b4ca8e67b28532c033a3855d1c5","tarball":"https://registry.npmjs.org/@0xkey-io/sdk-browser/-/sdk-browser-0.1.2.tgz","fileCount":82,"integrity":"sha512-fCpmBov7p/FnPA9gACjhui91gTsBHd3snQVRv+W2PYWJXAd4Uj0pzpQVKTE2qOzm/bCzkO1BCpOzzcQZqTFG7Q==","signatures":[{"sig":"MEUCIQCnh/l00tbarRZ0Uocx5pJycGKk7jxTc3HfMdLOfFT6AwIgaHDog3NmfQE7pWYSDyNR1azS26RRlnKbGjk374G5tvY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1481475},"main":"./dist/index.js","_from":"file:0xkey-io-sdk-browser-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"rollup -c","clean":"rimraf ./dist ./.cache","codegen":"node scripts/codegen.js","version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/__generated__/version.ts","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/tmp/4fb0c16b47ff2246b1bb8c871a97b407/0xkey-io-sdk-browser-0.1.2.tgz","_integrity":"sha512-fCpmBov7p/FnPA9gACjhui91gTsBHd3snQVRv+W2PYWJXAd4Uj0pzpQVKTE2qOzm/bCzkO1BCpOzzcQZqTFG7Q==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/sdk-browser"},"_npmVersion":"11.5.1","description":"JavaScript Browser SDK","directories":{},"_nodeVersion":"20.17.0","dependencies":{"buffer":"^6.0.3","hpke-js":"^1.6.5","cross-fetch":"^3.1.5","@0xkey-io/http":"0.1.2","@0xkey-io/crypto":"0.2.0","@0xkey-io/encoding":"0.1.1","@0xkey-io/sdk-types":"0.1.0","@0xkey-io/iframe-stamper":"0.1.0","@0xkey-io/wallet-stamper":"0.1.2","@0xkey-io/api-key-stamper":"0.1.2","@0xkey-io/webauthn-stamper":"0.1.0","@0xkey-io/indexed-db-stamper":"0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^8.0.3","typescript":"5.4.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk-browser_0.1.2_1782244150639_0.6824768277777054","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@0xkey-io/sdk-browser","version":"0.1.3","main":"./dist/index.js","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js","default":"./dist/index.mjs"}},"types":"./dist/index.d.ts","license":"Apache-2.0","description":"JavaScript Browser SDK","keywords":["0xkey"],"author":{"name":"0xkey","url":"https://0xkey.com"},"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/sdk-browser","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"repository":{"type":"git","url":"git+https://github.com/0xkey-io/sdk-js.git","directory":"packages/sdk-browser"},"publishConfig":{"access":"public"},"dependencies":{"buffer":"^6.0.3","cross-fetch":"^3.1.5","hpke-js":"^1.6.5","@0xkey-io/api-key-stamper":"0.1.3","@0xkey-io/crypto":"0.3.0","@0xkey-io/encoding":"0.1.1","@0xkey-io/iframe-stamper":"0.1.0","@0xkey-io/wallet-stamper":"0.1.3","@0xkey-io/http":"0.1.3","@0xkey-io/webauthn-stamper":"0.1.0","@0xkey-io/indexed-db-stamper":"0.1.3","@0xkey-io/sdk-types":"0.1.1"},"devDependencies":{"glob":"^8.0.3","typescript":"5.4.3"},"engines":{"node":">=18.0.0"},"scripts":{"version":"node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/__generated__/version.ts","build":"rollup -c","clean":"rimraf ./dist ./.cache","typecheck":"tsc -p tsconfig.typecheck.json","codegen":"node scripts/codegen.js"},"_id":"@0xkey-io/sdk-browser@0.1.3","_integrity":"sha512-7/lD8qt6Qe0UYBf6DhuplTErMJmTWs5UaMD9tw3Oik+Yddu7NJVFCzV1OsJ8ps2lfAQMdbV/BjDqnsmSPpEW2w==","_resolved":"/tmp/bd349d35551e02199023c09a9ee801bc/0xkey-io-sdk-browser-0.1.3.tgz","_from":"file:0xkey-io-sdk-browser-0.1.3.tgz","_nodeVersion":"20.17.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-7/lD8qt6Qe0UYBf6DhuplTErMJmTWs5UaMD9tw3Oik+Yddu7NJVFCzV1OsJ8ps2lfAQMdbV/BjDqnsmSPpEW2w==","shasum":"d17e707f3c541ab7dd5eebe0710ce5e069c6234b","tarball":"https://registry.npmjs.org/@0xkey-io/sdk-browser/-/sdk-browser-0.1.3.tgz","fileCount":82,"unpackedSize":1482110,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEm/kV34tXLNPMeQrzxGyD1ePdWx9mNbQmXBgfmKOFvSAiAokGq21qwPqBGcAON5gHtoNZCAY8vG3RCeQDvxOoxO+g=="}]},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"directories":{},"maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-browser_0.1.3_1783088343337_0.39236782836678974"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T09:52:35.379Z","modified":"2026-07-03T14:19:03.613Z","0.1.0":"2026-05-22T09:52:35.740Z","0.1.1":"2026-05-22T12:13:36.168Z","0.1.2":"2026-06-23T19:49:10.774Z","0.1.3":"2026-07-03T14:19:03.492Z"},"bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"author":{"name":"0xkey","url":"https://0xkey.com"},"license":"Apache-2.0","homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/sdk-browser","keywords":["0xkey"],"repository":{"type":"git","url":"git+https://github.com/0xkey-io/sdk-js.git","directory":"packages/sdk-browser"},"description":"JavaScript Browser SDK","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"readme":"# ⚠️ Deprecated: Use the New Core SDK\n\n> This package is deprecated and no longer actively maintained.\n>\n> We’ve released a new, improved core TypeScript client-side SDK package — [@0xkey-io/core](https://docs.0xkey.com/sdks/typescript-frontend) which provides a simpler, more powerful developer experience and better integration with modern JS frameworks.\n>\n> If you’re using React, please consider using the [@0xkey-io/react-wallet-kit](https://docs.0xkey.com/sdks/react/index) for a more tailored experience.\n\n# @0xkey-io/sdk-browser\n\n[![npm](https://img.shields.io/npm/v/@0xkey-io/sdk-browser?color=%234C48FF)](https://www.npmjs.com/package/@0xkey-io/sdk-browser)\n\nA SDK client with browser-specific abstractions for interacting with [ZeroXKey](https://0xkey.com) API. Also includes [@0xkey-io/http](https://www.npmjs.com/package/@0xkey-io/http), a lower-level, fully typed HTTP client.\n\nZeroXKey API documentation lives here: https://docs.0xkey.com.\n\n## Getting started\n\n```bash\n$ npm install @0xkey-io/sdk-browser\n```\n\n### Initialize\n\n```typescript\nimport { ZeroXKey } from \"@0xkey-io/sdk-browser\";\n\nconst 0xkey = new ZeroXKey({\n  apiBaseUrl: \"https://api.0xkey.com\",\n  defaultOrganizationId: process.env.ZEROXKEY_ORGANIZATION_ID,\n  // Optional: Your relying party ID - for use with Passkey authentication\n  rpId: process.env.ZEROXKEY_RP_ID,\n});\n```\n\n### ZeroXKey Clients\n\n#### Passkey\n\nThe Passkey client allows for authentication to ZeroXKey's API using Passkeys.\n\n```typescript\nconst passkeyClient = 0xkey.passkeyClient();\n\n// User will be prompted to login with their passkey\nawait passkeyClient.login();\n\n// Make authenticated requests to ZeroXKey API, such as listing user's wallets\nconst walletsResponse = await passkeyClient.getWallets();\n```\n\n#### Iframe\n\nThe Iframe client can be initialized to interact with ZeroXKey's hosted iframes for sensitive operations.\nThe `iframeContainer` parameter is required, and should be a reference to the DOM element that will host the iframe.\nThe `iframeUrl` is the URL of the iframe you wish to interact with.\n\nThe example below demonstrates how to initialize the Iframe client for use with [Email Auth](https://docs.0xkey.com/embedded-wallets/sub-organization-auth)\nby passing in `https://auth.0xkey.com` as the `iframeUrl`.\n\n```typescript\nconst iframeClient = await 0xkey.iframeClient({\n  // The container element that will host the iframe\n  iframeContainer: document.getElementById(\"<iframe container id>\"),\n  iframeUrl: \"https://auth.0xkey.com\",\n});\n\nconst injectedResponse = await iframeClient.injectCredentialBundle(\n  \"<Credential from Email>\",\n);\nif (injectedResponse) {\n  await iframeClient.getWallets();\n}\n```\n\n##### IFrame URLs:\n\n| Flow                                                                                | URL                                              |\n| ----------------------------------------------------------------------------------- | ------------------------------------------------ |\n| [Email Auth](https://docs.0xkey.com/embedded-wallets/sub-organization-auth)         | [auth.0xkey.com](https://auth.0xkey.com)         |\n| [Email Recovery](https://docs.0xkey.com/embedded-wallets/sub-organization-recovery) | [recovery.0xkey.com](https://recovery.0xkey.com) |\n| [Import Wallet](https://docs.0xkey.com/features/import-wallets)                     | [import.0xkey.com](https://import.0xkey.com)     |\n| [Export Wallet](https://docs.0xkey.com/features/export-wallets)                     | [export.0xkey.com](https://export.0xkey.com)     |\n\n#### Wallet\n\nThe Wallet client is designed for using your Solana or EVM wallet to stamp and approve activity requests for ZeroXKey's API.\nThis stamping process leverages the wallet's signature to authenticate requests.\n\nThe example below showcases how to use an injected Ethereum wallet to stamp requests to ZeroXKey's API.\nThe user will be prompted to sign a message containing the activity request payload to be sent to ZeroXKey.\n\n```typescript\nimport {\n  createWalletClient,\n  custom,\n  recoverPublicKey,\n  hashMessage,\n} from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { mainnet } from \"viem/chains\";\n\nimport { WalletStamper, EthereumWallet } from \"@0xkey-io/wallet-stamper\";\n\nconst walletClient = 0xkey.walletClient(new EthereumWallet());\n\n// Make authenticated requests to ZeroXKey API, such as listing user's wallets\n// User will be prompted to sign a message to authenticate the request\nconst walletsResponse = await walletClient.getWallets();\n```\n\n## Helpers\n\n`@0xkey-io/sdk-browser` provides `ZeroXKeySDKBrowserClient`, which offers wrappers around commonly used ZeroXKey activities, such as creating new wallets and wallet accounts.\n\n### IndexedDB Sessions (Recommended)\n\nZeroXKey now supports persistent, **secure, non-extractable authentication** using P-256 passkeys stored in **IndexedDB**. This replaces legacy iframe-based flows for otp, passkey, and OAuth authentication.\n\nThe [`ZeroXKeyIndexedDbClient`](https://github.com/0xkey-io/sdk-js/blob/main/packages/sdk-browser/src/__clients__/browser-clients.ts) provides a long-lived session mechanism where the private key never leaves the browser and is scoped per sub-organization. This client handles login, session persistence, and API request signing entirely on the client side — without requiring iframes or sensitive credential injection.\n\n```ts\nimport { ZeroXKey } from \"@0xkey-io/sdk-browser\";\n\nconst 0xkey = new ZeroXKey({\n  apiBaseUrl: \"https://api.0xkey.com\",\n  defaultOrganizationId: \"<YOUR_PARENT_ORG_ID>\",\n  rpId: \"<YOUR_WEBAUTHN_RELYING_PARTY_ID>\",\n});\n\nconst client = 0xkey.indexedDbClient();\nconst passkeyClient = 0xkey.passkeyClient();\n// Create authenticated session\nconst pubKey = await indexedDbClient!.getPublicKey();\nawait passkeyClient?.loginWithPasskey({\n  sessionType: SessionType.READ_WRITE,\n  publicKey: pubKey!,\n  expirationSeconds: \"3600\",\n});\n\n// Now the client is authenticated and ready to interact with ZeroXKey API\nconst wallets = await client.getWallets();\n```\n\n> 💡 **Why IndexedDB?**  \n> Keys are stored using the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey), marked as `nonExtractable`, and survive page reloads — offering persistent, tamper-resistant authentication without ever exposing the raw key material.\n\n---\n\n### ⚠️ Deprecated: iframeClient for Auth\n\nAuthentication via `iframeClient()` and injected credentials (e.g., from `https://auth.0xkey.com`) is now considered **deprecated** for new integrations. These flows required sensitive credential bundles to be delivered via email or OAuth and injected into a sandboxed iframe — a pattern with limited persistence and higher complexity.\n\nDevelopers are encouraged to migrate to `indexedDbClient()` for:\n\n- Seamless passkey authentication\n- Improved security model (no credential injection)\n- Long-lived, resumable sessions\n\nExisting iframe use cases like **Email Recovery**, **Wallet Import**, and **Wallet Export** are still supported but should be isolated from authentication logic.\n","readmeFilename":"README.md"}