{"_id":"@appdirect/auth-bff","_rev":"7-dfffd87098ad6e89343d10378eaf096f","name":"@appdirect/auth-bff","dist-tags":{"main":"0.0.1-main-d1c02e0","latest":"0.0.7"},"versions":{"0.0.1-main-4f2784c":{"name":"@appdirect/auth-bff","version":"0.0.1-main-4f2784c","keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"license":"MIT","_id":"@appdirect/auth-bff@0.0.1-main-4f2784c","maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"dist":{"shasum":"340da65eb135a378c72c4fe22f3f25f167655dba","tarball":"https://registry.npmjs.org/@appdirect/auth-bff/-/auth-bff-0.0.1-main-4f2784c.tgz","fileCount":49,"integrity":"sha512-ddWKo2OZq1KRl1+2cf740s6MExbRPY3xK8/0KjQ/GHGnCV0XvumFhsF3Vv9vyOQkrwNeUGTWSorof+5asVMnqA==","signatures":[{"sig":"MEUCIG1+O0VlHrU0CgmAOovAnx+akiBbT9mX7V2PckOBkertAiEAoncHUZPhA84jzS5qECWK54xxAX7I5Fgg3QwvQtGmYWs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":472800},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/adapters/next/app-router.d.ts","default":"./dist/adapters/next/app-router.js"},"require":{"types":"./dist/adapters/next/app-router.d.cts","default":"./dist/adapters/next/app-router.cjs"}},"./handlers":{"import":{"types":"./dist/adapters/handlers.d.ts","default":"./dist/adapters/handlers.js"},"require":{"types":"./dist/adapters/handlers.d.cts","default":"./dist/adapters/handlers.cjs"}}},"gitHead":"4f2784cd5b2b4fd2ed8ddc241ecae7778a736179","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"},"_npmVersion":"10.8.2","description":"AppDirect OIDC BFF SDK for Node.js backends","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.1.0","tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.0"},"peerDependencies":{"next":">=13.4.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-bff_0.0.1-main-4f2784c_1783595624449_0.4005846442924961","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-main-d1c02e0":{"name":"@appdirect/auth-bff","version":"0.0.1-main-d1c02e0","keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"license":"MIT","_id":"@appdirect/auth-bff@0.0.1-main-d1c02e0","maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"dist":{"shasum":"6b85938aeeb9f67ea98ff49a4609e0ae1b4ff191","tarball":"https://registry.npmjs.org/@appdirect/auth-bff/-/auth-bff-0.0.1-main-d1c02e0.tgz","fileCount":49,"integrity":"sha512-iQEmO5xdEcVsqsanWotghUNFpeUOq6xOoEP/dxpZ/GiYMJxEMG7wg4NBbo4TUvMuOZjMV0AmiDWbPqbyCLQPOQ==","signatures":[{"sig":"MEUCIQCCGnfq7869barELX9mHbvoVlIL6i9chEOrnuYeKGFoUgIgaV3bplx/PyKlTAtX9F/JAJDR51ZfdW5xZ8dYAiXHZlU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":483422},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/adapters/next/app-router.d.ts","default":"./dist/adapters/next/app-router.js"},"require":{"types":"./dist/adapters/next/app-router.d.cts","default":"./dist/adapters/next/app-router.cjs"}},"./handlers":{"import":{"types":"./dist/adapters/handlers.d.ts","default":"./dist/adapters/handlers.js"},"require":{"types":"./dist/adapters/handlers.d.cts","default":"./dist/adapters/handlers.cjs"}}},"gitHead":"d1c02e04a0a04ac8b90dde5d5b92d99726417403","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"},"_npmVersion":"10.8.2","description":"AppDirect OIDC BFF SDK for Node.js backends","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"next":"^15.1.0","tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.0"},"peerDependencies":{"next":">=13.4.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-bff_0.0.1-main-d1c02e0_1783716645427_0.23887352754978797","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@appdirect/auth-bff","version":"0.0.2","keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"license":"MIT","_id":"@appdirect/auth-bff@0.0.2","maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"dist":{"shasum":"e4ec04dc083f1aedf87d70360ee0e56760850c30","tarball":"https://registry.npmjs.org/@appdirect/auth-bff/-/auth-bff-0.0.2.tgz","fileCount":49,"integrity":"sha512-6NKTdJrBLnuPtM4WjLHSoZPOsgrJ7OjEBBf432iONZ5YpS0BfVUb5Ho6RKAp09lpTl1/6pM4NaC+OMnaz6PQaQ==","signatures":[{"sig":"MEUCIHQEYdTnhJX2f7XNl90ma92jiSG9TSlWzvtiWnVRth/LAiEAvFoxbyirra+PBlN/kfsANq1eYlYd6Aco2t7FfpEzQ5E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":483409},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/adapters/next/app-router.d.ts","default":"./dist/adapters/next/app-router.js"},"require":{"types":"./dist/adapters/next/app-router.d.cts","default":"./dist/adapters/next/app-router.cjs"}},"./handlers":{"import":{"types":"./dist/adapters/handlers.d.ts","default":"./dist/adapters/handlers.js"},"require":{"types":"./dist/adapters/handlers.d.cts","default":"./dist/adapters/handlers.cjs"}}},"gitHead":"561acfbdf0a7c58c71ca0085500bfb82d3641d55","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"},"_npmVersion":"10.8.2","description":"AppDirect OIDC BFF SDK for Node.js backends","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.1.0","tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.0"},"peerDependencies":{"next":">=13.4.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-bff_0.0.2_1784048053526_0.6852953908153037","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@appdirect/auth-bff","version":"0.0.3","keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"license":"MIT","_id":"@appdirect/auth-bff@0.0.3","maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"dist":{"shasum":"83d1445caf998a3175bc9e45d28456f509566269","tarball":"https://registry.npmjs.org/@appdirect/auth-bff/-/auth-bff-0.0.3.tgz","fileCount":49,"integrity":"sha512-uL/fIxaNnUkLxV2m60IHJnN4gS5tm0JDduzbXAdOcL9gkx84hLiNz44B67IbwHKMsqb0xFtUtFj6J99gQFEA5g==","signatures":[{"sig":"MEUCIQDzMvTOZRRvvawpLSjeaWksyjP+vzIRRPjtK7ScsdQ0mAIgLwh70d5fkTZ7Q3ypOtUtPWho8k3zx/dY5sM5syfSnHY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":526929},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/adapters/next/app-router.d.ts","default":"./dist/adapters/next/app-router.js"},"require":{"types":"./dist/adapters/next/app-router.d.cts","default":"./dist/adapters/next/app-router.cjs"}},"./handlers":{"import":{"types":"./dist/adapters/handlers.d.ts","default":"./dist/adapters/handlers.js"},"require":{"types":"./dist/adapters/handlers.d.cts","default":"./dist/adapters/handlers.cjs"}}},"gitHead":"96505a56774b4c7354e9cf8a197374489aa87a97","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"},"_npmVersion":"10.8.2","description":"AppDirect OIDC BFF SDK for Node.js backends","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.1.0","tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.0"},"peerDependencies":{"next":">=13.4.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-bff_0.0.3_1784587831654_0.7087311468674213","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@appdirect/auth-bff","version":"0.0.5","keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"license":"MIT","_id":"@appdirect/auth-bff@0.0.5","maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"dist":{"shasum":"b7e897e7543137abade15a032d8cd5fe3f91bd2b","tarball":"https://registry.npmjs.org/@appdirect/auth-bff/-/auth-bff-0.0.5.tgz","fileCount":49,"integrity":"sha512-/UBz/zD4RxbVM1oNlQZSMdZHxO8skzzqNXTRf/6JdMt50wtnJw733+c3+2uJVPlNnN2JcREA0KWabYMiZh9qqA==","signatures":[{"sig":"MEQCH3VRLsN14qxJPwoofX02mllprHb4JXcf++deQ5IWaNYCIQDV+yBdVM7H9IEb7PROr0Z2iW2VvIO2JAa1HzO674PLhg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":603196},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/adapters/next/app-router.d.ts","default":"./dist/adapters/next/app-router.js"},"require":{"types":"./dist/adapters/next/app-router.d.cts","default":"./dist/adapters/next/app-router.cjs"}},"./handlers":{"import":{"types":"./dist/adapters/handlers.d.ts","default":"./dist/adapters/handlers.js"},"require":{"types":"./dist/adapters/handlers.d.cts","default":"./dist/adapters/handlers.cjs"}}},"gitHead":"3cd438249016de89b2dad2df2768adab575a0b78","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"},"_npmVersion":"10.8.2","description":"AppDirect OIDC BFF SDK for Node.js backends","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.1.0","tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.0"},"peerDependencies":{"next":">=13.4.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-bff_0.0.5_1784762143369_0.5130207976825703","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@appdirect/auth-bff","version":"0.0.6","keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"license":"MIT","_id":"@appdirect/auth-bff@0.0.6","maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"dist":{"shasum":"f16491e64c17ef9ef5dd9852f0fdc9393d32a5b8","tarball":"https://registry.npmjs.org/@appdirect/auth-bff/-/auth-bff-0.0.6.tgz","fileCount":52,"integrity":"sha512-Dt32A1h0GfF7V85GvwXh+EUT9quHJ5LFA+9wdpIYOyCf+D7bposZW36WlG4AGzmzETkFFw3MANhZgQ1CbC1NqA==","signatures":[{"sig":"MEQCIHj+3Ais4GmUNYpKVqv8o62Ikb+oeX9igp95HXvUy49GAiBywYNyOTDH41ZTpiMuqNK48HzqyBaVB0HihPyFcBAOKQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":674093},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./next":{"import":{"types":"./dist/adapters/next/app-router.d.ts","default":"./dist/adapters/next/app-router.js"},"require":{"types":"./dist/adapters/next/app-router.d.cts","default":"./dist/adapters/next/app-router.cjs"}},"./handlers":{"import":{"types":"./dist/adapters/handlers.d.ts","default":"./dist/adapters/handlers.js"},"require":{"types":"./dist/adapters/handlers.d.cts","default":"./dist/adapters/handlers.cjs"}}},"gitHead":"343d5896e1e13d44fdc6355997fa34024a91438b","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"},"_npmVersion":"10.8.2","description":"AppDirect OIDC BFF SDK for Node.js backends","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"next":"^15.1.0","tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.0"},"peerDependencies":{"next":">=13.4.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-bff_0.0.6_1785178319766_0.6611463129222188","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@appdirect/auth-bff","version":"0.0.7","description":"AppDirect OIDC BFF SDK for Node.js backends","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"}},"./next":{"import":{"types":"./dist/adapters/next/app-router.d.ts","default":"./dist/adapters/next/app-router.js"},"require":{"types":"./dist/adapters/next/app-router.d.cts","default":"./dist/adapters/next/app-router.cjs"}},"./handlers":{"import":{"types":"./dist/adapters/handlers.d.ts","default":"./dist/adapters/handlers.js"},"require":{"types":"./dist/adapters/handlers.d.cts","default":"./dist/adapters/handlers.cjs"}}},"keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","prepublishOnly":"npm run build && npm run test"},"peerDependencies":{"next":">=13.4.0"},"peerDependenciesMeta":{"next":{"optional":true}},"devDependencies":{"@types/node":"^22.10.0","next":"^15.1.0","tsup":"^8.3.5","typescript":"^5.7.2","vitest":"^2.1.8"},"engines":{"node":">=18"},"license":"MIT","_id":"@appdirect/auth-bff@0.0.7","gitHead":"c114887e7338b0a7776b61cf89586bc6fcd413ff","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Fq2H+tx9GW78gnPWFwWKNn8D/Tviacx8+234+jvSLuYl62TEi+sY2ZpcbDS9/gs1hLL/koEdeLnWeKkrvFruuw==","shasum":"cafbb2b5c8c285f2590d885512ba632bfaa709b0","tarball":"https://registry.npmjs.org/@appdirect/auth-bff/-/auth-bff-0.0.7.tgz","fileCount":52,"unpackedSize":670625,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBW1hI7Um1ZhyIDI226o233faVY687PSWZc+CE+78PWtAiEA8cp80SUCphU2g9wMOma0uN3L+HSSsXq4t3PzwzByOzo="}]},"_npmUser":{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"},"directories":{},"maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-bff_0.0.7_1785184659438_0.6468635894202375"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-09T11:13:44.298Z","modified":"2026-07-27T20:37:40.194Z","0.0.1-main-4f2784c":"2026-07-09T11:13:44.586Z","0.0.1-main-d1c02e0":"2026-07-10T20:50:45.577Z","0.0.2":"2026-07-14T16:54:13.668Z","0.0.3":"2026-07-20T22:50:31.841Z","0.0.5":"2026-07-22T23:15:43.576Z","0.0.6":"2026-07-27T18:51:59.991Z","0.0.7":"2026-07-27T20:37:39.656Z"},"license":"MIT","keywords":["oauth","oidc","bff","appdirect","nextjs","serverless","handlers","authentication"],"description":"AppDirect OIDC BFF SDK for Node.js backends","maintainers":[{"name":"posabsolute","email":"cedric.dugas@gmail.com"},{"name":"drodriguez94","email":"david.rodriguez@appdirect.com"},{"name":"engineering.procurement","email":"engineering.procurement@appdirect.com"},{"name":"thecynicaldev","email":"tarik.abou-saddik@appdirect.com"}],"readme":"# @appdirect/auth-bff\n\nAppDirect OIDC **Backend-for-Frontend (BFF)** SDK for **Node.js** backends.\n\nThis package extracts AppDirect OAuth2/OIDC login, FEJWT session management, and token refresh into a reusable library. The browser never sees client secrets — only HttpOnly cookies and controlled API endpoints.\n\n## Features\n\n- Authorization Code flow with AppDirect (`/oauth2/authorize`, `/oauth2/token`, `/oauth2/userinfo`)\n- AppDirect session exchange (`/auth/token`, `/auth/refresh`) for application session tokens\n- **FEJWT-as-session** — session cookie stores the AppDirect FEJWT (~5 min TTL)\n- **Lazy auto-refresh** — refreshes FEJWT only when expired (~once per TTL), via `ensureValidFeJwt()`\n- **Single-flight refresh** — concurrent requests share one IdP refresh per warm instance\n- Refresh token rotation via HttpOnly `refresh_token` cookie\n- OAuth `state` CSRF protection via short-lived `oauth_state` cookie\n- **CHIPS (`Partitioned`) cookies** for cross-site iframe embeds (preview, shared links)\n- Framework-agnostic core + optional adapters for Next.js and Node route handlers\n- Full TypeScript types\n\n## Install\n\nPublished to the [public npm registry](https://www.npmjs.com/package/@appdirect/auth-bff):\n\n```bash\nnpm install @appdirect/auth-bff\n```\n\nFor local development against this repo:\n\n```bash\nnpm install file:../appdirect-auth-bff\n```\n\nOr install from a packed tarball:\n\n```bash\nnpm install ./appdirect-auth-bff-0.0.1.tgz\n```\n\n## Quick start — core SDK\n\nUse `createAppDirectAuth()` in any Node 18+ backend. Flows return data (cookies, redirects, user) — you wire HTTP yourself:\n\n```typescript\nimport { createAppDirectAuth } from '@appdirect/auth-bff';\n\nconst auth = createAppDirectAuth({\n  issuerBaseUrl: process.env.APPDIRECT_ISSUER_BASE_URL!,\n  clientId: process.env.APPDIRECT_CLIENT_ID!,\n  clientSecret: process.env.APPDIRECT_CLIENT_SECRET!,\n  appBaseUrl: process.env.APP_BASE_URL ?? 'http://localhost:3000',\n});\n\n// Login: auth.buildLoginRedirect() → authorizeUrl + cookiesToSet\n// Callback: auth.handleCallback({ code, state, cookies })\n// Session: auth.getMe(), auth.getFeJwt(), auth.refreshSession()\n```\n\nSee [Usage Reference](docs/USAGE.md) for the full API.\n\n## Quick start — Next.js App Router\n\n**1. Configure auth** (`lib/auth.ts`):\n\n```typescript\nimport { createNextAuthHandlers } from '@appdirect/auth-bff/next';\n\nexport const authHandlers = createNextAuthHandlers({\n  issuerBaseUrl: process.env.APPDIRECT_ISSUER_BASE_URL!,\n  clientId: process.env.APPDIRECT_CLIENT_ID!,\n  clientSecret: process.env.APPDIRECT_CLIENT_SECRET!,\n  appBaseUrl: process.env.NEXT_PUBLIC_APP_URL ?? 'http://localhost:3000',\n});\n```\n\n**2. Add route handlers** (`app/api/auth/login/route.ts`):\n\n```typescript\nimport { authHandlers } from '@/lib/auth';\nexport const GET = (req: Request) => authHandlers.login(req);\n```\n\nRepeat for `callback`, `me`, `jwt`, `refresh`, and `logout` — see [examples/nextjs-app-router](examples/nextjs-app-router).\n\nRequires `next` as a peer dependency. On Vercel, set `NEXT_PUBLIC_APP_URL` to your public deployment URL so post-login redirects use the correct origin.\n\n## Quick start — Node API route handlers\n\nFor file-based `api/auth/*` routes or any Node `(req, res)` serverless handler:\n\n```javascript\nimport { createAuthRouteHandlers } from '@appdirect/auth-bff/handlers';\n\nexport const handlers = createAuthRouteHandlers({\n  issuerBaseUrl: process.env.APPDIRECT_ISSUER_BASE_URL,\n  clientId: process.env.APPDIRECT_CLIENT_ID,\n  clientSecret: process.env.APPDIRECT_CLIENT_SECRET,\n  appBaseUrl: process.env.APP_BASE_URL ?? process.env.BASE_URL ?? 'http://localhost:3000',\n  // Cross-site iframe embeds (preview, shared links):\n  cookieOptions: { partitioned: true },\n});\n\nexport default function handler(req, res) {\n  return handlers.login(req, res);\n}\n```\n\nSee [examples/handlers](examples/handlers).\n\nCustom API routes (e.g. marketplace proxies) can use `readAuthCookies` and `applyCookieMutations` from `@appdirect/auth-bff/handlers` — see [Custom API routes](docs/USAGE.md#custom-api-routes) in the Usage Reference.\n\nThe [appdirect-auth-example](../appdirect-auth-example) repo is a full reference app (Next.js UI, Users API, subscription management).\n\n## Cross-site iframe embeds\n\nWhen the app runs inside a third-party iframe (e.g. App Builder preview or a shared-link viewer), enable CHIPS cookies:\n\n```typescript\ncookieOptions: { partitioned: true }\n```\n\nThe SDK then forces `Secure` and defaults `SameSite` to `None` (required for third-party contexts). See [cookieOptions](docs/USAGE.md#cookieoptions) in the Usage Reference.\n\n## Environment variables\n\n| Variable | Description |\n|----------|-------------|\n| `APPDIRECT_ISSUER_BASE_URL` | Marketplace base URL (no trailing slash) |\n| `APPDIRECT_CLIENT_ID` | OAuth client ID |\n| `APPDIRECT_CLIENT_SECRET` | OAuth client secret |\n| `APP_BASE_URL` / `BASE_URL` | App origin for OAuth redirect URI |\n| `NEXT_PUBLIC_APP_URL` | Next.js public app URL (required on Vercel) |\n| `AUTH_BFF_DEBUG` | Set to `true` to enable opt-in `[auth-bff:jwt]` / `[auth-bff:refresh]` debug logs |\n\nRegister callback: `{APP_URL}/api/auth/callback`\n\n## API routes provided by adapters\n\n| Route | Method | Purpose |\n|-------|--------|---------|\n| `/api/auth/login` | GET | Redirect to AppDirect authorize |\n| `/api/auth/callback` | GET | OAuth callback, set session cookies |\n| `/api/auth/me` | GET | Current user from FEJWT session |\n| `/api/auth/jwt` | GET | FEJWT for Global Header (auto-refresh) |\n| `/api/auth/refresh` | GET/POST | Manual token refresh |\n| `/api/auth/logout` | GET/POST | Clear session cookies |\n| `/api/auth/import-session` | POST | Import session tokens into HttpOnly cookies (iframe preview handoff) |\n\n## Documentation\n\n- [Architecture](docs/ARCHITECTURE.md) — design, flows, cookie model, security\n- [Implementation Guide](docs/IMPLEMENTATION.md) — step-by-step integration\n- [Usage Reference](docs/USAGE.md) — full API, config options, error codes\n\n## Development\n\n```bash\nnpm install\nnpm run build\nnpm test\nnpm run typecheck\n```\n\n## Examples\n\n- [examples/nextjs-app-router](examples/nextjs-app-router) — Next.js 15 App Router (minimal)\n- [examples/handlers](examples/handlers) — Node API route handlers\n- [appdirect-auth-example](../appdirect-auth-example) — Next.js reference app (Users + Billing API demos)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}