{"_id":"@casperid/react","_rev":"5-3997f306e0dc6c222574a5fdf056ba95","name":"@casperid/react","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@casperid/react","version":"1.0.0","author":{"name":"CasperID Team"},"license":"MIT","_id":"@casperid/react@1.0.0","maintainers":[{"name":"casperid","email":"abisoye.bello@gmail.com"}],"homepage":"https://casperid.com","bugs":{"url":"https://github.com/luxipha/CasperID/issues"},"dist":{"shasum":"23cbde81fa2774000bddfc8c8f7275204cfe7b7e","tarball":"https://registry.npmjs.org/@casperid/react/-/react-1.0.0.tgz","fileCount":31,"integrity":"sha512-1YAJ4TJDzfqZHUh4mfpZymrJIugkVjjkh3ddm5IpJLI6c3pUmLeApv8vVjs4UzQHrWynvm7B/X/WUK8jjTOfqg==","signatures":[{"sig":"MEQCIFFQRYCgyzcMyswETLjidp8gf3jGH3st1Gu5Q2wMAyHPAiBtVZX0aBruOOG1TaCIZKhmO+ZSEe/l6xpPNZYCNCK3Jg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1254164},"main":"dist/index.cjs","type":"module","types":"src/index.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./src/index.ts","default":"./dist/index.mjs"},"require":{"types":"./src/index.ts","default":"./dist/index.cjs"}},"./style.css":"./dist/style.css"},"gitHead":"f9770ec44528dac3873dbbaf4d95a0b7b941f20b","scripts":{"dev":"vite --port=3001","lint":"tsc --noEmit","build":"tsc --noEmit && vite build","prepublishOnly":"npm run build"},"_npmUser":{"name":"casperid","email":"abisoye.bello@gmail.com"},"repository":{"url":"git+https://github.com/luxipha/CasperID.git","type":"git","directory":"sdk/packages/react"},"_npmVersion":"11.6.0","description":"CasperID Identity SDK — embeddable React modal for authentication and KYC verification","directories":{},"sideEffects":["*.css"],"_nodeVersion":"24.10.0","dependencies":{"lucide-react":"^0.400.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.2.0","typescript":"~5.8.2","tailwindcss":"^4.1.0","@types/react":"^18","@types/react-dom":"^18","@tailwindcss/vite":"^4.1.0","@vitejs/plugin-react":"^5.0.0"},"peerDependencies":{"react":">=18","react-dom":">=18","framer-motion":">=10"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.0_1773475987874_0.4981913633092794","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@casperid/react","version":"1.0.1","keywords":["casper","identity","verification","blockchain","did","passkey","zkp","privacy","react","sdk","auth"],"author":{"name":"CasperID Team"},"license":"MIT","_id":"@casperid/react@1.0.1","maintainers":[{"name":"casperid","email":"abisoye.bello@gmail.com"}],"homepage":"http://casperid.com/business/docs","bugs":{"url":"https://github.com/luxipha/CasperID/issues"},"dist":{"shasum":"58803e81d576f6a954711b212a51a33d9a840e86","tarball":"https://registry.npmjs.org/@casperid/react/-/react-1.0.1.tgz","fileCount":31,"integrity":"sha512-asGYqsneusdxj/w7gm92bqs1o+QcAYE+9vvsIFkU3WZb8BOvpusFVW88LGaMm0zFJipIALIQbWDzKK7R+nR5MQ==","signatures":[{"sig":"MEYCIQDuch+q/FfMbqThotjt/uTQx1f2k7WFGbPzAJ/1fzHh9AIhAMafTfCIQY07Uzc3Uch8n7f1noOjaB5YAkL+66G3Y8ap","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1254418},"main":"dist/index.cjs","type":"module","types":"src/index.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./src/index.ts","default":"./dist/index.mjs"},"require":{"types":"./src/index.ts","default":"./dist/index.cjs"}},"./style.css":"./dist/style.css"},"gitHead":"f9770ec44528dac3873dbbaf4d95a0b7b941f20b","scripts":{"dev":"vite --port=3001","lint":"tsc --noEmit","build":"tsc --noEmit && vite build","prepublishOnly":"npm run build"},"_npmUser":{"name":"casperid","email":"abisoye.bello@gmail.com"},"repository":{"url":"git+https://github.com/luxipha/CasperID.git","type":"git","directory":"sdk/packages/react"},"_npmVersion":"11.6.0","description":"CasperID Identity SDK — embeddable React modal for authentication and KYC verification","directories":{},"sideEffects":["*.css"],"_nodeVersion":"24.10.0","dependencies":{"lucide-react":"^0.400.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.2.0","typescript":"~5.8.2","tailwindcss":"^4.1.0","@types/react":"^18","@types/react-dom":"^18","@tailwindcss/vite":"^4.1.0","@vitejs/plugin-react":"^5.0.0"},"peerDependencies":{"react":">=18","react-dom":">=18","framer-motion":">=10"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.1_1773476552145_0.3935062135583005","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@casperid/react","version":"1.1.0","keywords":["casper","identity","verification","blockchain","did","passkey","zkp","privacy","react","sdk","auth"],"author":{"name":"CasperID Team"},"license":"MIT","_id":"@casperid/react@1.1.0","maintainers":[{"name":"casperid","email":"abisoye.bello@gmail.com"}],"homepage":"https://casperid.com","bugs":{"url":"https://github.com/luxipha/CasperID-sdk/issues"},"dist":{"shasum":"8653ada68e0c3b1d6349773934e4a92ea1e530f8","tarball":"https://registry.npmjs.org/@casperid/react/-/react-1.1.0.tgz","fileCount":19,"integrity":"sha512-rrQ3UrfP6jaTN3Qz6lnX1Z15P8vHQlArb13uTn27nIaI2sDrw7QepgA4NNfv8TWkZfR8J9hOjgTwsD9K3V4+Xg==","signatures":[{"sig":"MEQCIEQJThFhSql4g4HM4ROSJi3O8FAna+h9wHHeBcnC7f+MAiAqLX1MsJw1kzrjISgelrgn5DfbmucJE4uf7Lr/OK6qag==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1714330},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./style.css":"./dist/style.css"},"gitHead":"7b884e6e7fb7e82ac45f94e724692312ceca6b09","scripts":{"dev":"vite --port=3001","lint":"tsc --noEmit","build":"tsc --noEmit && vite build","prepublishOnly":"npm run build"},"_npmUser":{"name":"casperid","email":"abisoye.bello@gmail.com"},"repository":{"url":"git+https://github.com/luxipha/CasperID-sdk.git","type":"git"},"_npmVersion":"11.6.0","description":"CasperID Identity SDK — embeddable React modal for authentication and KYC verification","directories":{},"sideEffects":["*.css"],"_nodeVersion":"24.10.0","dependencies":{"lucide-react":"^0.400.0","@mediapipe/face_mesh":"^0.4.1633559619","@mediapipe/camera_utils":"^0.3.1620248257"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.2.0","typescript":"~5.8.2","tailwindcss":"^4.1.0","@types/react":"^18","@types/react-dom":"^18","@tailwindcss/vite":"^4.1.0","@vitejs/plugin-react":"^5.0.0"},"peerDependencies":{"react":">=18","react-dom":">=18","framer-motion":">=10"},"_npmOperationalInternal":{"tmp":"tmp/react_1.1.0_1777829729034_0.9680002403008205","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@casperid/react","version":"2.0.0","keywords":["casper","identity","verification","blockchain","did","passkey","zkp","privacy","react","sdk","auth"],"author":{"name":"CasperID Team"},"license":"MIT","_id":"@casperid/react@2.0.0","maintainers":[{"name":"casperid","email":"abisoye.bello@gmail.com"}],"homepage":"https://casperid.com","bugs":{"url":"https://github.com/luxipha/CasperID-sdk/issues"},"dist":{"shasum":"4ba6a71531baedeebd70f828a62503bd936b1ce7","tarball":"https://registry.npmjs.org/@casperid/react/-/react-2.0.0.tgz","fileCount":6,"integrity":"sha512-1gZZpxG8x9oNGgJIb2Pe80iErAM3aBGQg6AE/0BfCKA9wVrdt7RzVm4jmB0TeSlSTK7x1UCIaiExAqLoMlCb5Q==","signatures":[{"sig":"MEUCIQDfetKLINthN9FOTdHJ0vJKHr2b6B5nLKD+qB1TMC8QHgIgRb+msBe2NPoObqgOwFNqJec9xeh2nm6JCVQ8wD8qQRw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74216},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}}},"gitHead":"c985df4a233d37c3882aad69414ef163a8425fb1","scripts":{"dev":"vite --port=3001","lint":"tsc --noEmit","test":"vitest","build":"tsc --noEmit && vite build","test:run":"vitest run","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"casperid","email":"abisoye.bello@gmail.com"},"repository":{"url":"git+https://github.com/luxipha/CasperID-sdk.git","type":"git"},"_npmVersion":"11.6.0","description":"Lightweight React SDK for CasperID hosted authorization","directories":{},"_nodeVersion":"24.10.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.2.0","jsdom":"^29.1.1","vitest":"^4.1.6","typescript":"~5.8.2","tailwindcss":"^4.1.0","@types/react":"^18","@types/react-dom":"^18","@tailwindcss/vite":"^4.1.0","@vitejs/plugin-react":"^5.0.0","@testing-library/react":"^16.3.2","@testing-library/jest-dom":"^6.9.1","@testing-library/user-event":"^14.6.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/react_2.0.0_1781430689297_0.06538249693723364","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@casperid/react","version":"2.0.1","description":"Lightweight React SDK for CasperID hosted authorization","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","type":"module","keywords":["casper","identity","verification","blockchain","did","passkey","zkp","privacy","react","sdk","auth"],"author":{"name":"CasperID Team"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/luxipha/CasperID-sdk.git"},"bugs":{"url":"https://github.com/luxipha/CasperID-sdk/issues"},"homepage":"https://casperid.com","scripts":{"dev":"vite --port=3001","build":"tsc --noEmit && vite build","lint":"tsc --noEmit","test":"vitest","test:run":"vitest run","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"peerDependencies":{"react":">=18","react-dom":">=18"},"dependencies":{},"devDependencies":{"@tailwindcss/vite":"^4.1.0","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.1","@types/react":"^18","@types/react-dom":"^18","@vitejs/plugin-react":"^5.0.0","jsdom":"^29.1.1","tailwindcss":"^4.1.0","typescript":"~5.8.2","vite":"^6.2.0","vitest":"^4.1.6"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}}},"_id":"@casperid/react@2.0.1","gitHead":"ac063609ecaf5c258993584317cfe24b7b8015c7","_nodeVersion":"24.10.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-UfqllfLxM2keaJfizmOVy6gtulKB8RCY7yEEb11smqNRAPMQh9bxK8o74DyR8Q7LD2VMUStUjJeWkNo17GShQw==","shasum":"b19f6117424ab9268d72f397096aef7dd435bd36","tarball":"https://registry.npmjs.org/@casperid/react/-/react-2.0.1.tgz","fileCount":6,"unpackedSize":80751,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDGvJQ6W7nAoJbxxDRntY9Yn6RTF5FzXCPuYcZKQK0laAiAa+BeQ+yFGTRTGt+xNc3rbskyan4gY74ZmxKMmqQ2iuw=="}]},"_npmUser":{"name":"casperid","email":"abisoye.bello@gmail.com"},"directories":{},"maintainers":[{"name":"casperid","email":"abisoye.bello@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react_2.0.1_1781689516924_0.4673001487744719"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-14T08:13:07.791Z","modified":"2026-06-17T09:45:17.195Z","1.0.0":"2026-03-14T08:13:08.083Z","1.0.1":"2026-03-14T08:22:32.395Z","1.1.0":"2026-05-03T17:35:29.240Z","2.0.0":"2026-06-14T09:51:29.488Z","2.0.1":"2026-06-17T09:45:17.057Z"},"bugs":{"url":"https://github.com/luxipha/CasperID-sdk/issues"},"author":{"name":"CasperID Team"},"license":"MIT","homepage":"https://casperid.com","keywords":["casper","identity","verification","blockchain","did","passkey","zkp","privacy","react","sdk","auth"],"repository":{"type":"git","url":"git+https://github.com/luxipha/CasperID-sdk.git"},"description":"Lightweight React SDK for CasperID hosted authorization","maintainers":[{"name":"casperid","email":"abisoye.bello@gmail.com"}],"readme":"# @casperid/react\n\nThe official React SDK for integrating CasperID — the privacy-first, decentralized identity layer for the open web.\n\n## Hosted Authorization\n\nPasskeys registered for `casperid.com` must be used from the CasperID account domain. SDK v2 starts the hosted flow and does not embed identity or KYC screens in the partner application.\n\n```tsx\nimport { authorizeWithCasperID } from '@casperid/react';\n\nconst result = await authorizeWithCasperID({\n  clientId: 'app_your_client_id',\n  redirectUri: `${window.location.origin}/auth/callback`,\n  accountUrl: 'https://account.casperid.com',\n  mode: 'auto',\n  // Optional. Popup flows default to 30 minutes; set 0 to disable.\n  timeoutMs: 30 * 60 * 1000,\n});\n```\n\n`auto` opens a popup on desktop and redirects the full page on mobile. On the callback route, call `consumeHostedAuthorizationCallback()`. Send its `code`, `codeVerifier`, and `redirectUri` to your backend, which exchanges them at `POST /api/oauth/token` using the app secret. Never expose the app secret in frontend code.\n\n## Why CasperID?\n\nCasperID provides a \"Sign in with Google\" style experience but with the security and ownership of Web3.\n\n- **Biometric Security:** Native Passkey (WebAuthn) support for passwordless, secure logins.\n- **Privacy by Design:** Selective disclosure via Zero-Knowledge Proofs (ZKP). Only share what you need (e.g., \"Over 18\") without revealing raw data.\n- **User Ownership:** Identities (DIDs) are owned by users on the Casper blockchain, not by a central authority.\n- **Verification Tiers:** Securely handle everything from simple email verification (L1) to full KYC document verification (L3).\n\n## Installation\n\n```bash\nnpm install @casperid/react\n```\n\n## Quick Start\n\n```tsx\nimport { CasperIDButton, useHostedAuthorizationCallback } from '@casperid/react';\n\nfunction App() {\n  const handleSuccess = (result) => {\n    // Send result.code, result.codeVerifier, and result.redirectUri to your backend.\n  };\n  useHostedAuthorizationCallback(handleSuccess, console.error);\n\n  return (\n    <CasperIDButton\n      clientId=\"app_your_client_id\"\n      redirectUri={`${window.location.origin}/auth/callback`}\n      mode=\"auto\"\n      timeoutMs={30 * 60 * 1000}\n      onSuccess={handleSuccess}\n      onError={console.error}\n    >\n      Continue with CasperID\n    </CasperIDButton>\n  );\n}\n```\n\n## Backend Exchange\n\nExchange the authorization code server-side at `POST /api/oauth/token` using your app secret and PKCE verifier. Never expose the app secret in browser code.\n\n### Understanding User Identity\n\nThe returned business token includes:\n\n- **`humanId`**: This is the unique, user-friendly handle (e.g., `alice.casper`). **This should be prioritized for your UI.**\n- **`name`**: The user's verified full name (or `null` if not shared).\n- **`wallet`**: The Casper wallet address.\n- **`authorization_status`**: `complete` or `provisional`.\n- **`required_tier` / `tier`**: The app's required tier and the user's actual tier.\n- **`scopes`**: The permissions approved by the user.\n\n## Documentation\n\nFor full documentation, visit [casperid.com/business/docs](http://casperid.com/business/docs).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}