{"_id":"@superfunctions/oauth-core","_rev":"5-9bcc0782757c79c3eeca91e8fb754bae","name":"@superfunctions/oauth-core","dist-tags":{"latest":"0.2.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","keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/oauth-core@0.1.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":"3448d7ddf4cfe582b31e0b97afd2f2dca1a81aa8","tarball":"https://registry.npmjs.org/@superfunctions/oauth-core/-/oauth-core-0.1.1.tgz","fileCount":8,"integrity":"sha512-+ebX7P4vwFfPKehLTpsvpVpxlKoONECFJgciuGdug0tkYnz6pmVXzNCWVb4NDDfyPHo/W76Z17PPbV2afuVEww==","signatures":[{"sig":"MEQCIExDtrBzZeW6HuJnsQTqy9Z2o5sqtpIU9Ytask5ANZSAAiBWCjYlP5MELyndzspR9/0faBumy6gNryAYr9sUfdq2ig==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":132081},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"c95b3f50d7b8f51a37a35da65a5ca7d02d53abe4","scripts":{"lint":"echo 'lint not configured'","test":"vitest --config ./vitest.config.ts --run","build":"tsup","clean":"node --input-type=module -e \"import('node:fs').then(({ rmSync }) => rmSync('dist', { recursive: true, force: true }))\"","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":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@superfunctions/oauth-storage":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/oauth-core_0.1.1_1788006047892_0.7067389760371185","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@superfunctions/oauth-core","version":"0.2.0","keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/oauth-core@0.2.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":"98ca5f4bff322ab2741c544fe6b5906725f76bc0","tarball":"https://registry.npmjs.org/@superfunctions/oauth-core/-/oauth-core-0.2.0.tgz","fileCount":8,"integrity":"sha512-OVzyxJsYWdG2U64JiGo3zfrJtK885PsB1vXRjugUEIoA6rJqTRYpE8TJvirYCQYJ7YwBkzBvDhKYdVEXIFWJ2A==","signatures":[{"sig":"MEQCIECBQ8pwettIG0xU6jyxz7ucLHTDefWRHyObFj1hjtrfAiBZP0IzNKVjY5U4sT8nBVLrFhCVWKU5u/iHh0VnHin3xg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIGRNZkjQxQjzb0IrvvVXqIHbfhMnULo3mw334jJzaW2pAiEArGEf5wxh8r6YHcm2rlhs7ZxgIkhjNxwZHdJcoAL0V9E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":134244},"main":"./dist/index.cjs","type":"module","_from":"file:/tmp/npm-release-O4SGIA/superfunctions-oauth-core-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"11f7e104d2d59f62ac94ab2dd06fc01144d0390b","scripts":{"lint":"tsc --noEmit","test":"vitest --config ./vitest.config.ts --run","build":"tsup","clean":"node --input-type=module -e \"import('node:fs').then(({ rmSync }) => rmSync('dist', { recursive: true, force: true }))\"","typecheck":"tsc --noEmit","test:watch":"vitest --config ./vitest.config.ts --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"_resolved":"/tmp/npm-release-O4SGIA/superfunctions-oauth-core-0.2.0.tgz","_integrity":"sha512-OVzyxJsYWdG2U64JiGo3zfrJtK885PsB1vXRjugUEIoA6rJqTRYpE8TJvirYCQYJ7YwBkzBvDhKYdVEXIFWJ2A==","repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/oauth-core"},"_npmVersion":"10.9.9","description":"Core OAuth types and service contracts for Superfunctions","directories":{},"sideEffects":false,"_nodeVersion":"22.23.3","dependencies":{"@superfunctions/oauth-storage":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/oauth-core_0.2.0_1791104317251_0.5259944948081339","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"_id":"@superfunctions/oauth-core@0.2.1","bugs":{"url":"https://github.com/21nCo/superfunctions/issues"},"dist":{"shasum":"bd7225fc4b531f2cdd88dca276690174288f04b7","tarball":"https://registry.npmjs.org/@superfunctions/oauth-core/-/oauth-core-0.2.1.tgz","fileCount":8,"integrity":"sha512-5Py9ipLVQmtZX7iA8SobS2BAKo9x0QuKe+wXaMQfqRNcpKXDkPNim01wLYd+ZyYzzET2NfNxSVJg4CfqvzSZZQ==","signatures":[{"sig":"MEUCIDggsqXpA6P1Ia3BoQcoxTbfqv6/fJXYmd9Eofz9dVNwAiEAl7bZv0ziPVtgkOxfEGM8bH1QCMjeJYqXY4eJshbXL2Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAm+giiuB7AujD+Mtm1ooW7C/IV4BNFtJ6gJIsjFrAdpAiAGaqRiJz7iR8SttxY3E1+thZgPfD+4jTZByumrb3B17A=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@superfunctions%2foauth-core@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":134243},"main":"./dist/index.cjs","name":"@superfunctions/oauth-core","type":"module","_from":"file:/home/runner/work/_temp/npm-package/superfunctions-oauth-core-0.2.1.tgz","types":"./dist/index.d.ts","author":{"name":"21n"},"module":"./dist/index.js","engines":{"node":">=18.18.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"699d9d09932199d660333c57fe7bc646492ea3bf","license":"MIT","scripts":{"lint":"tsc --noEmit","test":"vitest --config ./vitest.config.ts --run","build":"tsup","clean":"node --input-type=module -e \"import('node:fs').then(({ rmSync }) => rmSync('dist', { recursive: true, force: true }))\"","typecheck":"tsc --noEmit","test:watch":"vitest --config ./vitest.config.ts --watch"},"version":"0.2.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"d51a27bf-2ed2-46fe-9ca4-b4a6d3a794d7"}},"homepage":"https://github.com/21nCo/superfunctions#readme","keywords":["oauth","auth","superfunctions"],"_resolved":"/home/runner/work/_temp/npm-package/superfunctions-oauth-core-0.2.1.tgz","_integrity":"sha512-5Py9ipLVQmtZX7iA8SobS2BAKo9x0QuKe+wXaMQfqRNcpKXDkPNim01wLYd+ZyYzzET2NfNxSVJg4CfqvzSZZQ==","repository":{"url":"git+https://github.com/21nCo/superfunctions.git","type":"git","directory":"packages/oauth-core"},"_npmVersion":"11.21.0","description":"Core OAuth types and service contracts for Superfunctions","directories":{},"maintainers":[{"name":"21native","email":"npm@21n.org"}],"sideEffects":false,"_nodeVersion":"22.23.4","dependencies":{"@superfunctions/oauth-storage":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oauth-core_0.2.1_1794344295486_0.2386411732885122"}}},"time":{"created":"2026-05-14T09:28:35.103Z","modified":"2026-11-10T20:58:16.000Z","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","0.2.0":"2026-10-04T08:58:37.330Z","0.2.1":"2026-11-10T20:58:15.587Z"},"bugs":{"url":"https://github.com/21nCo/superfunctions/issues"},"author":{"name":"21n"},"license":"MIT","homepage":"https://github.com/21nCo/superfunctions#readme","keywords":["oauth","auth","superfunctions"],"repository":{"url":"git+https://github.com/21nCo/superfunctions.git","type":"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### Provider transport descriptors\n\n`OAuthProviderDescriptor` includes optional transport fields consumed by\n`@superfunctions/oauth-http`: `tokenBodyEncoding` defaults to form encoding;\n`tokenHeaders` adds provider-required request headers; `authorizationCodeTokenPath`\nselects a nested authorization-code token object without changing refresh response\nparsing; and `revocationResponse: \"json-ok\"` requires an explicit JSON `ok: true`\neven when the provider returns HTTP 200. Omitting these fields preserves the\ndefault root-token and HTTP-status behavior.\n\nPackage-local `npm test` resolves installed dependency exports, not sibling\nsources. Install the declared registry prerequisites before running release gates.\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"}