{"_id":"@dooor-ai/auth-core","_rev":"6-83ced9f49c4c16e4e2d4e9148a680556","name":"@dooor-ai/auth-core","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@dooor-ai/auth-core","version":"0.1.0","keywords":["dooor","auth","oidc","oauth","pkce"],"license":"MIT","_id":"@dooor-ai/auth-core@0.1.0","maintainers":[{"name":"bruno353","email":"brunolsantos152@gmail.com"}],"homepage":"https://github.com/Dooor-AI/dooor-auth-js/tree/main/packages/auth-core#readme","bugs":{"url":"https://github.com/Dooor-AI/dooor-auth-js/issues"},"dist":{"shasum":"b2060bae490c62ffc23a7b5b9a754d9a339d3d18","tarball":"https://registry.npmjs.org/@dooor-ai/auth-core/-/auth-core-0.1.0.tgz","fileCount":8,"integrity":"sha512-+n7HUlJmJW1J4D4o3PJlOOrSH3za430i7Uvwy7RPt+qVc3ogSwbomNmU+Wh42acSZtBS4TKI/5QjlBp/D0tuRw==","signatures":[{"sig":"MEYCIQC9k58+kndq/jSGhtsGVfz9YchidYsVG74n+9NLruFPMwIhAKF0vZWkDz/10TC0qNdE0uBwUFQtN+dlSlijwiNf7tuK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64575},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"78b9508d473a2f0a09de6b798b5e50c1748c2bfc","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bruno353","email":"brunolsantos152@gmail.com"},"repository":{"url":"git+https://github.com/Dooor-AI/dooor-auth-js.git","type":"git","directory":"packages/auth-core"},"_npmVersion":"11.6.2","description":"Framework-agnostic OIDC client helpers for Dooor Auth (authorize URL, PKCE, token exchange, refresh).","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.0.0","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.1.0_1784135410155_0.18240734411847992","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dooor-ai/auth-core","version":"0.1.1","keywords":["dooor","auth","oidc","oauth","pkce"],"license":"MIT","_id":"@dooor-ai/auth-core@0.1.1","maintainers":[{"name":"bruno353","email":"brunolsantos152@gmail.com"}],"homepage":"https://github.com/Dooor-AI/dooor-auth-js/tree/main/packages/auth-core#readme","bugs":{"url":"https://github.com/Dooor-AI/dooor-auth-js/issues"},"dist":{"shasum":"7288a5a46898ce9222d280cfa85fc2bc50ce6087","tarball":"https://registry.npmjs.org/@dooor-ai/auth-core/-/auth-core-0.1.1.tgz","fileCount":8,"integrity":"sha512-000Uk8+BfwdlrpZ19eEJ3Cg03gbRso8ddsBsyQDNpkLSvQ0xgY+ZBFU5l5XZUC30vSSzkMlqE0bwz6L2F0Wcqw==","signatures":[{"sig":"MEUCIQDv86Vx/tdFJzQ4vWdDkELqJqSHbD5kU3V0fBY8uBpY+AIgPMY7uXrSf/sXI3C+Z064kABdCFOeV7iyxbAthrten4M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64611},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"78b9508d473a2f0a09de6b798b5e50c1748c2bfc","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bruno353","email":"brunolsantos152@gmail.com"},"repository":{"url":"git+https://github.com/Dooor-AI/dooor-auth-js.git","type":"git","directory":"packages/auth-core"},"_npmVersion":"11.6.2","description":"Framework-agnostic OIDC client helpers for Dooor Auth (authorize URL, PKCE, token exchange, refresh).","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.0.0","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.1.1_1784135520687_0.9775943909516993","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dooor-ai/auth-core","version":"0.1.2","keywords":["dooor","auth","oidc","oauth","pkce"],"license":"MIT","_id":"@dooor-ai/auth-core@0.1.2","maintainers":[{"name":"bruno353","email":"brunolsantos152@gmail.com"}],"homepage":"https://github.com/Dooor-AI/dooor-auth-js/tree/main/packages/auth-core#readme","bugs":{"url":"https://github.com/Dooor-AI/dooor-auth-js/issues"},"dist":{"shasum":"e13aa9f79741918e1e3df2231929e483ad246ef9","tarball":"https://registry.npmjs.org/@dooor-ai/auth-core/-/auth-core-0.1.2.tgz","fileCount":8,"integrity":"sha512-JXI/I9RhTRB9FVgas5UqZsLXeik9F5GeaVlpZ21c1GZZ7lMXgyUFHlCCsvVG1HMiWKmxd8vM1ScXIDGzdj5SsQ==","signatures":[{"sig":"MEUCIQCkTpvwLhIrgmLWe5ZMm4m8NZPBaZHXX3CYMKPXeL0D+gIgHuvw4L0vn9UTKBO15DpX0oB7MqVHhFyUzkjCkiJE6kA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64611},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"78b9508d473a2f0a09de6b798b5e50c1748c2bfc","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bruno353","email":"brunolsantos152@gmail.com"},"repository":{"url":"git+https://github.com/Dooor-AI/dooor-auth-js.git","type":"git","directory":"packages/auth-core"},"_npmVersion":"11.6.2","description":"Framework-agnostic OIDC client helpers for Dooor Auth (authorize URL, PKCE, token exchange, refresh).","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.0.0","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.1.2_1784135643938_0.17728889422256922","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@dooor-ai/auth-core","version":"0.1.3","keywords":["dooor","auth","oidc","oauth","pkce"],"license":"MIT","_id":"@dooor-ai/auth-core@0.1.3","maintainers":[{"name":"bruno353","email":"brunolsantos152@gmail.com"}],"homepage":"https://github.com/Dooor-AI/dooor-auth-js/tree/main/packages/auth-core#readme","bugs":{"url":"https://github.com/Dooor-AI/dooor-auth-js/issues"},"dist":{"shasum":"9a13684e53046d7592306997d04d6e292e5e7453","tarball":"https://registry.npmjs.org/@dooor-ai/auth-core/-/auth-core-0.1.3.tgz","fileCount":8,"integrity":"sha512-i9DW8xDcRdRSk2zjYYzwmG0mI3AzW6n6KNzfu/dtiAZxumK4FO9kRDYi3eAHTc3eTzczmpid+d2f+MMVJmmr7g==","signatures":[{"sig":"MEUCIHOPRhgCdWIGLrSXdGJTrxp/LRSL5hMqd24MOxoNxOp3AiEArwKprv5TTbAWnMDNxx70CgCuir5YcHT0NDfTUysRGc0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66995},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"3d469e10b0084763b70fee5d88cc70197d1d071d","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bruno353","email":"brunolsantos152@gmail.com"},"repository":{"url":"git+https://github.com/Dooor-AI/dooor-auth-js.git","type":"git","directory":"packages/auth-core"},"_npmVersion":"11.8.0","description":"Framework-agnostic OIDC client helpers for Dooor Auth (authorize URL, PKCE, token exchange, refresh).","directories":{},"sideEffects":false,"_nodeVersion":"25.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.0.0","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.1.3_1784137751949_0.5302131041721534","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dooor-ai/auth-core","version":"0.2.0","keywords":["dooor","auth","oidc","oauth","pkce"],"license":"MIT","_id":"@dooor-ai/auth-core@0.2.0","maintainers":[{"name":"bruno353","email":"brunolsantos152@gmail.com"}],"homepage":"https://github.com/Dooor-AI/dooor-auth-js/tree/main/packages/auth-core#readme","bugs":{"url":"https://github.com/Dooor-AI/dooor-auth-js/issues"},"dist":{"shasum":"330c773ba54b9d17ba1094e0d714119e7caaf6af","tarball":"https://registry.npmjs.org/@dooor-ai/auth-core/-/auth-core-0.2.0.tgz","fileCount":9,"integrity":"sha512-jamlnUsBHhqJpm8zvnl5+6UL7IQXFF9+U1gDssNPgikS/4j0oY0Fw5YnV6ORp4dIx36aZSEUW9ifTx0AfcahAg==","signatures":[{"sig":"MEYCIQD0Hw2ZI+nwG2tE0WSmMNTBI2SclQA3cQpnDNKxi8sKxwIhAILW3Lq6NOYekb/o3oYtRFtCwkDcrOBjdWA5hhmcFVRY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68083},"main":"./dist/index.cjs","type":"module","_from":"file:dooor-ai-auth-core-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bruno353","email":"brunolsantos152@gmail.com"},"_resolved":"/tmp/d7b894d5fcb87d82b49eee9b8933cb60/dooor-ai-auth-core-0.2.0.tgz","_integrity":"sha512-jamlnUsBHhqJpm8zvnl5+6UL7IQXFF9+U1gDssNPgikS/4j0oY0Fw5YnV6ORp4dIx36aZSEUW9ifTx0AfcahAg==","repository":{"url":"git+https://github.com/Dooor-AI/dooor-auth-js.git","type":"git","directory":"packages/auth-core"},"_npmVersion":"10.8.2","description":"Framework-agnostic OIDC client helpers for Dooor Auth (authorize URL, PKCE, token exchange, refresh).","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.0.0","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.2.0_1786029520693_0.6423087960538207","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dooor-ai/auth-core","version":"0.3.0","description":"Framework-agnostic OIDC client helpers for Dooor Auth (authorize URL, PKCE, token exchange, refresh).","license":"MIT","type":"module","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Dooor-AI/dooor-auth-js.git","directory":"packages/auth-core"},"homepage":"https://github.com/Dooor-AI/dooor-auth-js/tree/main/packages/auth-core#readme","bugs":{"url":"https://github.com/Dooor-AI/dooor-auth-js/issues"},"keywords":["dooor","auth","oidc","oauth","pkce"],"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"publishConfig":{"access":"public"},"devDependencies":{"tsup":"^8.5.0","typescript":"^5.7.0","vitest":"^3.0.0"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","lint":"tsc --noEmit","clean":"rm -rf dist"},"_id":"@dooor-ai/auth-core@0.3.0","_integrity":"sha512-7a0mDmMlFXxiQYBlmEQ4gHYgDeCO+nvJR8OQmsRPEldR/KEZ571FANkbmy4sIQn2G+dOCo13XC7mAS37VOw4mw==","_resolved":"/tmp/4e7f04a69463df61a858039b7a7ba2c4/dooor-ai-auth-core-0.3.0.tgz","_from":"file:dooor-ai-auth-core-0.3.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-7a0mDmMlFXxiQYBlmEQ4gHYgDeCO+nvJR8OQmsRPEldR/KEZ571FANkbmy4sIQn2G+dOCo13XC7mAS37VOw4mw==","shasum":"27b207ccfa4516c53d147897b0ce5a2b5d078ea1","tarball":"https://registry.npmjs.org/@dooor-ai/auth-core/-/auth-core-0.3.0.tgz","fileCount":9,"unpackedSize":69809,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICxhXbKLA1r1WnDe6UZbiCTW7x0R1dO89TH6Jvw46F3IAiEAjHIl3TDCQBp2L2At726TO/QXn1TI1xKLg07QKfua/1Q="}]},"_npmUser":{"name":"bruno353","email":"brunolsantos152@gmail.com"},"directories":{},"maintainers":[{"name":"bruno353","email":"brunolsantos152@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-core_0.3.0_1787574269444_0.8721948453851835"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-15T17:10:09.883Z","modified":"2026-08-24T12:24:29.821Z","0.1.0":"2026-07-15T17:10:10.314Z","0.1.1":"2026-07-15T17:12:00.837Z","0.1.2":"2026-07-15T17:14:04.072Z","0.1.3":"2026-07-15T17:49:12.123Z","0.2.0":"2026-08-06T15:18:40.859Z","0.3.0":"2026-08-24T12:24:29.584Z"},"bugs":{"url":"https://github.com/Dooor-AI/dooor-auth-js/issues"},"license":"MIT","homepage":"https://github.com/Dooor-AI/dooor-auth-js/tree/main/packages/auth-core#readme","keywords":["dooor","auth","oidc","oauth","pkce"],"repository":{"type":"git","url":"git+https://github.com/Dooor-AI/dooor-auth-js.git","directory":"packages/auth-core"},"description":"Framework-agnostic OIDC client helpers for Dooor Auth (authorize URL, PKCE, token exchange, refresh).","maintainers":[{"name":"bruno353","email":"brunolsantos152@gmail.com"}],"readme":"# @dooor-ai/auth-core\n\nFramework-agnostic OIDC client helpers for [Dooor Auth](https://api.os.dooor.ai): build the authorize URL, generate PKCE pairs, parse the callback, and exchange/refresh tokens. Zero framework dependencies, uses `fetch` and the Web Crypto API.\n\nMost apps use `@dooor-ai/auth-react` or `@dooor-ai/auth-node` instead, which depend on this package internally. Use `auth-core` directly if you're integrating with a custom framework or writing your own SDK adapter.\n\n## Install\n\n```bash\nnpm i @dooor-ai/auth-core\n```\n\n## Usage\n\n```ts\nimport { buildAuthorizeUrl, createPkcePair, generateState, exchangeCode } from \"@dooor-ai/auth-core\";\n\nconst pkce = await createPkcePair();\nconst state = generateState();\n\nconst authorizeUrl = buildAuthorizeUrl({\n  publishableKey: process.env.NEXT_PUBLIC_DOOOR_AUTH_PUBLISHABLE_KEY!,\n  redirectUri: \"https://my-app.example.com/api/dooor-auth/callback\",\n  state,\n  codeChallenge: pkce.codeChallenge,\n});\n\n// redirect the browser to `authorizeUrl`, persist `pkce.codeVerifier` and `state`\n// server-side (short-lived cookie), then on callback:\n\nconst tokens = await exchangeCode({\n  publishableKey: process.env.NEXT_PUBLIC_DOOOR_AUTH_PUBLISHABLE_KEY!,\n  redirectUri: \"https://my-app.example.com/api/dooor-auth/callback\",\n  code, // from the callback query string\n  codeVerifier: pkce.codeVerifier,\n});\n```\n\n## API\n\n- `buildAuthorizeUrl(options)` - builds the `/v1/idp/authorize` URL.\n- `generateCodeVerifier()`, `generateCodeChallenge(verifier)`, `createPkcePair()` - PKCE (S256) helpers per RFC 7636.\n- `generateState()` - opaque anti-CSRF `state` value.\n- `parseCallback(input)` - extracts `code`/`state`/`error` from a URL, query string, or params object.\n- `exchangeCode(options)` - trades an authorization code + `code_verifier` for a token set.\n- `refreshToken(options)` - redeems a rotating refresh token for a new token set.\n- `MemoryTokenStore` - in-memory `TokenStore` implementation (not persisted across reloads).\n\nDefault issuer is `https://api.os.dooor.ai`; pass `issuer` to any function to target a different environment.\n\n## Scopes\n\n`buildAuthorizeUrl` requests `openid profile email offline_access` by default. `offline_access` is what makes the IdP issue a rotating refresh token - drop it only if you genuinely want a session that ends when the 5-minute access token expires.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}