{"_id":"@superfunctions/oauth-flow","_rev":"2-85f3cd9df50365e5be04faa1fad7b360","name":"@superfunctions/oauth-flow","dist-tags":{"latest":"0.1.0"},"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","description":"High-level OAuth orchestration contracts for Superfunctions","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc","test":"vitest --config ./vitest.config.ts --run","test:watch":"vitest --config ./vitest.config.ts --watch","lint":"echo 'lint not configured'","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"keywords":["oauth","auth","superfunctions"],"author":{"name":"21n"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/21nCo/super-functions.git","directory":"packages/oauth-flow"},"publishConfig":{"access":"public"},"dependencies":{"@superfunctions/oauth-core":"0.1.0","@superfunctions/oauth-http":"0.1.0","@superfunctions/oauth-storage":"0.1.0"},"devDependencies":{"@types/node":"^22.0.0","typescript":"^5.6.0","vitest":"^3.2.4"},"_id":"@superfunctions/oauth-flow@0.1.0","gitHead":"e11bd81db6390dbc38303a5f3da6baadbaef0c8b","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-Sa5LfITL9gp19rjyJCHU+bhhc/PJOikRSYwGQCs66ZvGklgBPdYxpKx1LMmPWSSojbRUPl1Ci6VQgz1dDo5AwA==","shasum":"728a8322d83dc004e5e5d422e0af3a5f9bda0a37","tarball":"https://registry.npmjs.org/@superfunctions/oauth-flow/-/oauth-flow-0.1.0.tgz","fileCount":10,"unpackedSize":89769,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC3rigKE6oMUouImUn5DgyhdhEO9bOe+9CIUlXwdNG3WwIhAO3xFqsi3TEtSbSL+6pDa0EJ2P+wAgqafBBHVJ3PsiZF"}]},"_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-flow_0.1.0_1787981905547_0.32898919433611074"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-14T09:43:52.961Z","modified":"2026-08-29T05:38:25.863Z","0.0.1":"2026-05-14T09:43:53.216Z","0.1.0":"2026-08-29T05:38:25.689Z"},"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-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"}