{"_id":"@apollo1213/obelisk-js","name":"@apollo1213/obelisk-js","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@apollo1213/obelisk-js","version":"0.1.0","description":"Official JavaScript SDK for Obelisk passkey authentication.","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json"},"keywords":["obelisk","passkey","webauthn","sdk"],"author":{"name":"Obelisk"},"license":"MIT","dependencies":{"@simplewebauthn/browser":"^11.0.0"},"devDependencies":{"typescript":"^5.6.3"},"_id":"@apollo1213/obelisk-js@0.1.0","gitHead":"27539bc5f6ac407ebd8f2fdeda09eed98646861e","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-sDg3FxNBlJgHr1seMtRXISbYVQjIYwJoHDGtyCEZkCkbKN1otHcDEjld2dw3nJlzoUymC8j6eh0g+3hW2lkcJg==","shasum":"31392a5e49400c3ca07ff2338a6e2a8c026207b1","tarball":"https://registry.npmjs.org/@apollo1213/obelisk-js/-/obelisk-js-0.1.0.tgz","fileCount":18,"unpackedSize":24483,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFlwXhbh2u0I/AKoQPRj1+Wp5T2LM/CQjYxxKnQL5qQBAiBdI/jIK1gwQFMCRVwuyEa4WTx555ciqcoQtmHw/XFwpQ=="}]},"_npmUser":{"name":"apollo1213","email":"apollopollard1@gmail.com"},"directories":{},"maintainers":[{"name":"apollo1213","email":"apollopollard1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/obelisk-js_0.1.0_1763942559526_0.6724224811883843"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-24T00:02:39.459Z","0.1.0":"2025-11-24T00:02:39.742Z","modified":"2025-11-24T00:02:40.048Z"},"maintainers":[{"name":"apollo1213","email":"apollopollard1@gmail.com"}],"description":"Official JavaScript SDK for Obelisk passkey authentication.","keywords":["obelisk","passkey","webauthn","sdk"],"author":{"name":"Obelisk"},"license":"MIT","readme":"# obelisk-js\n\nOfficial JavaScript/TypeScript SDK for Obelisk passkey authentication. Wraps the Obelisk HTTP APIs and [`@simplewebauthn/browser`](https://github.com/MasterKale/SimpleWebAuthn) so developers can add passwordless login with just a few lines of code.\n\n## Installation\n\n```bash\nnpm install @apollo1213/obelisk-js\n```\n\n## Quick Start\n\n```ts\nimport { Obelisk } from '@apollo1213/obelisk-js';\n\nconst obelisk = new Obelisk({\n  apiUrl: 'https://api.obelisk.dev',\n  apiKey: 'OBELISK_PUBLIC_KEY'\n});\n\nawait obelisk.registerPasskey('user@example.com');\nconst session = await obelisk.loginWithPasskey();\n```\n\n## API\n\n### `new Obelisk(options)`\n\n| Option | Type | Description |\n| --- | --- | --- |\n| `apiUrl` | `string` | Required base URL of the Obelisk backend. |\n| `apiKey` | `string` | Public API key for the current site/app. Never use private keys in the browser. |\n| `userResolver` | `() => Promise<string>` | Optional async callback returning the current user ID/email for flows that require it. |\n\n### `registerPasskey(email: string): Promise<void>`\nStarts the WebAuthn attestation ceremony for the provided user and finalizes it with the backend. Replaces any existing key for that user.\n\n### `loginWithPasskey(): Promise<ObeliskSession>`\nRuns the authentication ceremony and returns session data from the backend.\n\n### `replacePasskey(): Promise<void>`\nHelper that shows a friendly message and re-runs `registerPasskey` when the existing key is invalid.\n\n### `autoLogin(): Promise<ObeliskSession | null>`\nAttempts `loginWithPasskey`. If it fails for recoverable reasons it calls `replacePasskey`. Returns `null` if manual intervention is required.\n\n## Error Handling\n\nEvery API throws subclasses of `ObeliskError` with descriptive messages. Network issues throw `NetworkError`, WebAuthn issues throw `CredentialMissingError` or `ChallengeError` depending on context.\n\n## Building\n\n```bash\nnpm install\nnpm run build\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-8da77ffff3defcbbe7f8b45dbe9822ac"}