{"_id":"@superfunctions/oauth-flow","_rev":"3-40066cd7d94261c09f5e0497e596d4c9","name":"@superfunctions/oauth-flow","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"@superfunctions/oauth-flow","version":"0.0.1","keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/oauth-flow@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":"e895c6a8fd016ef3b3597d4ad8ac0debd961bfe6","tarball":"https://registry.npmjs.org/@superfunctions/oauth-flow/-/oauth-flow-0.0.1.tgz","fileCount":10,"integrity":"sha512-V2n6iQR8y0eJ/DfzgzIiMzKcJHNk5tRB7+b7Q5TYe8Fk6mpIV8aLTJ1lmHOgIzellYu8Xm7m+TObZ5YmKWCUSw==","signatures":[{"sig":"MEUCIQCPuUE9TyFcKjN4yXeY77KtgOtlgo7AIHgPNoE7NKsxSAIgEDKeIy+WhbYupkNOiYXH8W0SmhotcpSJ3G7W//Z7P8s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89320},"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-flow"},"_npmVersion":"10.8.2","description":"High-level OAuth orchestration contracts for Superfunctions","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@superfunctions/oauth-core":"0.0.1","@superfunctions/oauth-http":"0.0.1","@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-flow_0.0.1_1778751833084_0.002532213780928272","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@superfunctions/oauth-flow","version":"0.1.0","keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/oauth-flow@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":"728a8322d83dc004e5e5d422e0af3a5f9bda0a37","tarball":"https://registry.npmjs.org/@superfunctions/oauth-flow/-/oauth-flow-0.1.0.tgz","fileCount":10,"integrity":"sha512-Sa5LfITL9gp19rjyJCHU+bhhc/PJOikRSYwGQCs66ZvGklgBPdYxpKx1LMmPWSSojbRUPl1Ci6VQgz1dDo5AwA==","signatures":[{"sig":"MEYCIQC3rigKE6oMUouImUn5DgyhdhEO9bOe+9CIUlXwdNG3WwIhAO3xFqsi3TEtSbSL+6pDa0EJ2P+wAgqafBBHVJ3PsiZF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89769},"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-flow"},"_npmVersion":"10.8.2","description":"High-level OAuth orchestration contracts for Superfunctions","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@superfunctions/oauth-core":"0.1.0","@superfunctions/oauth-http":"0.1.0","@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-flow_0.1.0_1787981905547_0.32898919433611074","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@superfunctions/oauth-flow@0.1.1","bugs":{"url":"https://github.com/21nCo/superfunctions/issues"},"dist":{"shasum":"3dfa774c312bf2f0dad1f00ba43953bce63340c2","tarball":"https://registry.npmjs.org/@superfunctions/oauth-flow/-/oauth-flow-0.1.1.tgz","fileCount":10,"integrity":"sha512-WFBAZL1baQblRy1lFRZoNP7qcJLFc2kWZSYcT1zU3/hsOyiFhudKIhC64jGpPTZ7FcUKsJuaopYj5irfTncg+A==","signatures":[{"sig":"MEUCIQDgUDrvglcrFEM4F+VqAeYqoeQBXq98iLvS87+KxwD33wIgO8F6BEj8PEdf36kaZZAwlaybBN6rhyGtNkeQ9QOOjjc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDq6BNB5evQ6QGsl1T57fCx4WVRehib42ub308vkubfmAiAw6moK8uV97ISs4GYC/xUYyNMK2E+XLCb8leNGV25pPg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@superfunctions%2foauth-flow@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":89811},"main":"./dist/index.js","name":"@superfunctions/oauth-flow","type":"module","_from":"file:/home/runner/work/_temp/npm-package/superfunctions-oauth-flow-0.1.1.tgz","types":"./dist/index.d.ts","author":{"name":"21n"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"699d9d09932199d660333c57fe7bc646492ea3bf","license":"MIT","scripts":{"lint":"tsc --noEmit","test":"vitest --config ./vitest.config.ts --run","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --config ./vitest.config.ts --watch"},"version":"0.1.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"ec6eee7e-ecea-463e-bcca-bb74ab8ef874"}},"homepage":"https://github.com/21nCo/superfunctions#readme","keywords":["oauth","auth","superfunctions"],"_resolved":"/home/runner/work/_temp/npm-package/superfunctions-oauth-flow-0.1.1.tgz","_integrity":"sha512-WFBAZL1baQblRy1lFRZoNP7qcJLFc2kWZSYcT1zU3/hsOyiFhudKIhC64jGpPTZ7FcUKsJuaopYj5irfTncg+A==","repository":{"url":"git+https://github.com/21nCo/superfunctions.git","type":"git","directory":"packages/oauth-flow"},"_npmVersion":"11.21.0","description":"High-level OAuth orchestration contracts for Superfunctions","directories":{},"maintainers":[{"name":"21native","email":"npm@21n.org"}],"_nodeVersion":"22.23.4","dependencies":{"@superfunctions/oauth-core":"0.1.1","@superfunctions/oauth-http":"0.1.0","@superfunctions/oauth-storage":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oauth-flow_0.1.1_1794344337155_0.7307143974161779"}}},"time":{"created":"2026-05-14T09:43:52.961Z","modified":"2026-11-10T20:58:57.614Z","0.0.1":"2026-05-14T09:43:53.216Z","0.1.0":"2026-08-29T05:38:25.689Z","0.1.1":"2026-11-10T20:58:57.232Z"},"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-flow"},"description":"High-level OAuth orchestration contracts for Superfunctions","maintainers":[{"name":"21native","email":"npm@21n.org"}],"readme":"# @superfunctions/oauth-flow\n\nHigh-level OAuth lifecycle orchestration for start, callback, refresh, and disconnect workflows.\n\n## Install\n\n```bash\nnpm install @superfunctions/oauth-flow @superfunctions/oauth-providers @superfunctions/oauth-storage\n```\n\n## Quick Start\n\n```ts\nimport { createOAuthFlowService } from \"@superfunctions/oauth-flow\";\nimport { getOAuthProviderDescriptor } from \"@superfunctions/oauth-providers\";\nimport {\n  AesGcmTokenCipher,\n  EncryptedTokenVault,\n  MemoryOAuthStateStore,\n  MemoryTokenVault,\n} from \"@superfunctions/oauth-storage\";\n\nconst encryptionKeyHex = process.env.OAUTH_TOKEN_ENCRYPTION_KEY_HEX!;\nconst tokenVault = new EncryptedTokenVault(\n  new MemoryTokenVault(),\n  new AesGcmTokenCipher(() => Buffer.from(encryptionKeyHex, \"hex\")),\n);\n\nconst flow = createOAuthFlowService({\n  providers: {\n    github: getOAuthProviderDescriptor(\"github\"),\n  },\n  providerRuntimeConfig: {\n    github: {\n      clientId: process.env.GITHUB_CLIENT_ID!,\n      clientSecret: process.env.GITHUB_CLIENT_SECRET!,\n      allowlistedRedirectUris: [\"https://app.example/oauth/github/callback\"],\n    },\n  },\n  stateStore: new MemoryOAuthStateStore(),\n  tokenVault,\n});\n```\n\n## Package Boundary\n\n`@superfunctions/oauth-flow` composes:\n\n- `@superfunctions/oauth-core` for state and callback invariants\n- `@superfunctions/oauth-http` for token transport\n- `@superfunctions/oauth-storage` for state/token persistence\n\nIt owns orchestration and lifecycle hooks, not route adapters. Use `@superfunctions/oauth-router` when you want reusable HTTP endpoints.\n\nKeep `OAUTH_TOKEN_ENCRYPTION_KEY_HEX` as a deployment secret with 32 random bytes encoded as hex.\n\n## Production Notes\n\n- `EncryptedTokenVault` defaults to `tokenStorageMode: \"encrypted-required\"`.\n- Legacy plain `TokenVault` wiring stays writable by default for backward compatibility, but new production deployments should migrate to `EncryptedTokenVault`.\n- Set `tokenStorageMode: \"encrypted-required\"` explicitly if you want upgrades to fail closed on plaintext persistence.\n- `plaintext-unsafe` is for tests, local prototypes, and temporary migration windows only.\n- `disconnect()` now reports `connectionCleanup`, and `connectionDeleted` remains only as a deprecated compatibility alias of `connectionCleanup.deleted`.\n- Keep `resolveProviderRuntimeConfig` deterministic across app servers and background workers.\n\n## Verification\n\n- Repo-root gate: `npm run gate:packages-oauth-shared`\n- Package-local tests: `npm test --workspace @superfunctions/oauth-flow`\n\n## Related Packages\n\n- OAuth core primitives: [../oauth-core/README.md](../oauth-core/README.md)\n- Shared storage: [../oauth-storage/README.md](../oauth-storage/README.md)\n- Route factories: [../oauth-router/README.md](../oauth-router/README.md)\n","readmeFilename":"README.md"}