{"_id":"@superfunctions/oauth-core","_rev":"3-046116cc38e11921081d7885181c8d6c","name":"@superfunctions/oauth-core","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"@superfunctions/oauth-core","version":"0.0.1","keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/oauth-core@0.0.1","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"dist":{"shasum":"e4d602d0df76fdfff91bb9d85a78907b4230aa47","tarball":"https://registry.npmjs.org/@superfunctions/oauth-core/-/oauth-core-0.0.1.tgz","fileCount":18,"integrity":"sha512-rInZ3CdZ5oGmV5FuZ/lqJm6SPj8nSRW+qqKq1PWgTOtd0mLCQzQBAiDxhRnfofetQjCHA/8KKTCbjYz0B2sPTA==","signatures":[{"sig":"MEUCIHZzpndmqWQ0GfBesrT3k7gtOG565esEg9rVKbZTjwK3AiEAvo7+BPM6DyecOdap51IMp+74xEQhLPKn/hNEomCuDPA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37939},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"c566cac4b41a7b4a55ff128aad6471f275f03e22","scripts":{"lint":"echo 'lint not configured'","test":"vitest --config ./vitest.config.ts --run","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --config ./vitest.config.ts --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/oauth-core"},"_npmVersion":"10.8.2","description":"Core OAuth types and service contracts for Superfunctions","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@superfunctions/oauth-storage":"0.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/oauth-core_0.0.1_1778750915181_0.033818002820670046","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@superfunctions/oauth-core","version":"0.1.0","keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/oauth-core@0.1.0","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"dist":{"shasum":"76cc93d7832c11e3ca7082617264a01ac4965547","tarball":"https://registry.npmjs.org/@superfunctions/oauth-core/-/oauth-core-0.1.0.tgz","fileCount":18,"integrity":"sha512-jRqEV2tz+wtX4ene4wl2D/1qEQl4BxAmuOQQftScgVHy6AkXb4mJHaTojS5im2G8zA/Xg4yYsEqRUsON2gY0gw==","signatures":[{"sig":"MEQCIETRixnFemc2sk6xpHnmIcBB+y+tFWAFCKEaPWCqCqFdAiAGqQ6lPndZxOPuAllPjttluB0Z8PdhKZlu4/wfJpZm5A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38459},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"e11bd81db6390dbc38303a5f3da6baadbaef0c8b","scripts":{"lint":"echo 'lint not configured'","test":"vitest --config ./vitest.config.ts --run","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --config ./vitest.config.ts --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/oauth-core"},"_npmVersion":"10.8.2","description":"Core OAuth types and service contracts for Superfunctions","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@superfunctions/oauth-storage":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/oauth-core_0.1.0_1787981514972_0.32135263541294257","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@superfunctions/oauth-core","version":"0.1.1","description":"Core OAuth types and service contracts for Superfunctions","type":"module","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.cts","default":"./dist/index.cjs"}}},"scripts":{"build":"tsup","test":"vitest --config ./vitest.config.ts --run","test:watch":"vitest --config ./vitest.config.ts --watch","lint":"echo 'lint not configured'","typecheck":"tsc --noEmit","clean":"node --input-type=module -e \"import('node:fs').then(({ rmSync }) => rmSync('dist', { recursive: true, force: true }))\""},"keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/21nCo/super-functions.git","directory":"packages/oauth-core"},"publishConfig":{"access":"public"},"dependencies":{"@superfunctions/oauth-storage":"0.1.0"},"devDependencies":{"@types/node":"^22.0.0","tsup":"^8.5.0","typescript":"^5.6.0","vitest":"^3.2.4"},"engines":{"node":">=18.18.0"},"sideEffects":false,"_id":"@superfunctions/oauth-core@0.1.1","gitHead":"c95b3f50d7b8f51a37a35da65a5ca7d02d53abe4","bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"homepage":"https://github.com/21nCo/super-functions#readme","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-+ebX7P4vwFfPKehLTpsvpVpxlKoONECFJgciuGdug0tkYnz6pmVXzNCWVb4NDDfyPHo/W76Z17PPbV2afuVEww==","shasum":"3448d7ddf4cfe582b31e0b97afd2f2dca1a81aa8","tarball":"https://registry.npmjs.org/@superfunctions/oauth-core/-/oauth-core-0.1.1.tgz","fileCount":8,"unpackedSize":132081,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIExDtrBzZeW6HuJnsQTqy9Z2o5sqtpIU9Ytask5ANZSAAiBWCjYlP5MELyndzspR9/0faBumy6gNryAYr9sUfdq2ig=="}]},"_npmUser":{"name":"21native","email":"npm@21n.org"},"directories":{},"maintainers":[{"name":"21native","email":"npm@21n.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oauth-core_0.1.1_1788006047892_0.7067389760371185"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-14T09:28:35.103Z","modified":"2026-08-29T12:20:48.193Z","0.0.1":"2026-05-14T09:28:35.314Z","0.1.0":"2026-08-29T05:31:55.119Z","0.1.1":"2026-08-29T12:20:48.040Z"},"bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"author":{"name":"21n"},"license":"MIT","homepage":"https://github.com/21nCo/super-functions#readme","keywords":["oauth","auth","superfunctions"],"repository":{"type":"git","url":"git+https://github.com/21nCo/super-functions.git","directory":"packages/oauth-core"},"description":"Core OAuth types and service contracts for Superfunctions","maintainers":[{"name":"21native","email":"npm@21n.org"}],"readme":"# @superfunctions/oauth-core\n\nShared OAuth primitives for provider descriptors, PKCE, redirect validation, and callback invariants.\n\n## Install\n\n```bash\nnpm install @superfunctions/oauth-core @superfunctions/oauth-storage\n```\n\n## Quick Start\n\n```ts\nimport { DefaultOAuthService } from \"@superfunctions/oauth-core\";\nimport { MemoryOAuthStateStore } from \"@superfunctions/oauth-storage\";\n\nconst oauth = new DefaultOAuthService({\n  providers: {\n    github: {\n      id: \"github\",\n      authorizationUrl: \"https://github.com/login/oauth/authorize\",\n      tokenUrl: \"https://github.com/login/oauth/access_token\",\n      defaultScopes: [\"read:user\"],\n      supportsPkce: true,\n      supportsRefreshToken: false,\n      tokenAuthMethod: \"client_secret_post\",\n    },\n  },\n  providerRuntimeConfig: {\n    github: {\n      clientId: process.env.GITHUB_CLIENT_ID!,\n      allowlistedRedirectUris: [\"https://app.example/oauth/callback\"],\n    },\n  },\n  stateStore: new MemoryOAuthStateStore(),\n  async exchangeCodeForToken() {\n    return { accessToken: \"access-token\" };\n  },\n});\n```\n\n## Package Boundary\n\n`@superfunctions/oauth-core` owns protocol-safe OAuth building blocks:\n\n- provider descriptors\n- authorization request creation\n- redirect allowlist checks\n- PKCE/state generation\n- one-time callback state consumption\n\nIt does not own HTTP transport, token persistence, or route exposure. Use:\n\n- `@superfunctions/oauth-http` for token exchange and revoke transport\n- `@superfunctions/oauth-storage` for state/token persistence\n- `@superfunctions/oauth-flow` when you want start/callback/refresh/disconnect orchestration\n- `@superfunctions/oauth-router` when you want reusable HTTP routes on top of `oauth-flow`\n\n## Production Notes\n\n- Keep provider descriptors static and resolve client/runtime secrets outside source control.\n- Treat redirect allowlists as exact-match security controls, not loose prefixes.\n- Use durable storage for issued state records in multi-instance deployments.\n- Prefer `@superfunctions/oauth-flow` unless you intentionally need custom orchestration.\n\n## Related Packages\n\n- Shared storage: [../oauth-storage/README.md](../oauth-storage/README.md)\n- Flow orchestration: [../oauth-flow/README.md](../oauth-flow/README.md)\n- Route factories: [../oauth-router/README.md](../oauth-router/README.md)\n","readmeFilename":"README.md"}