{"_id":"@benbraide/auth-service-nextjs","_rev":"9-ee2819fb61b81121541e3116ab379a5f","name":"@benbraide/auth-service-nextjs","dist-tags":{"latest":"1.6.0"},"versions":{"1.0.0":{"name":"@benbraide/auth-service-nextjs","version":"1.0.0","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.0.0","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"91405b24ac00cbc56fc90d14909c958f9669d364","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.0.0.tgz","fileCount":22,"integrity":"sha512-ObK/pZ6VqruKsherNJpWpXlXwxaf04p0YZ1HZQjEiXpxt/5I7wxZr73zGGYQssJwEqw3dJI0H8mjUZxwUjBHrw==","signatures":[{"sig":"MEUCIHd4XYbuN5cb4JRZ/cJ9E9cAj5OtjPDR3ZAGcdtuQb4MAiEA8tNdWPh6O3dpxWxJx1iiUCJXXE+Tzj97AOQkRD4x+7M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":606134},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"}},"gitHead":"7c6c6791c9961f63aad66c1343b0e2bfd6d865e4","scripts":{"dev":"tsup --watch","build":"tsup","upload":"npm publish --access public","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.0.0_1759715647963_0.3015226866514653","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@benbraide/auth-service-nextjs","version":"1.1.0","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.1.0","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"2e30d758668e27cb0a1405ad85436d43f88308e2","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.1.0.tgz","fileCount":22,"integrity":"sha512-HCaar66hgn2VqfuqTPHf6l4hYJ8ZqroJEBhABAUkspsex1G6vrU8Dl3o9V08w1AtG4mLS0/FHMlw29FuV0c0iw==","signatures":[{"sig":"MEUCIQDQTXv/nfAY5c8TSFW8eTzIrBykwD+2mR/WGbwOgPDzNAIgHgEbGmFVuVjCgO1ni9kIYnTpUtadhV0DU6+7T/0DyjE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":606134},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"}},"gitHead":"799c84d8b142575056659c90b0e3940c28e449cb","scripts":{"dev":"tsup --watch","build":"tsup","upload":"npm publish --access public","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.1.0_1760557916470_0.5486892655047004","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@benbraide/auth-service-nextjs","version":"1.1.1","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.1.1","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"8300703cdb01397dfc306f193ea393700b572123","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.1.1.tgz","fileCount":22,"integrity":"sha512-QbZa+JonDX9x3Ic0yD+1xrZWX9+KwVibNaPnhvMQfYz6U1B2/8tkO21On+7/4/rnV/FgyVz0MiVT6U/SR9K4mg==","signatures":[{"sig":"MEUCIQC1KX9Wv+FJm887XkEE80kjjAZIXbqdPu5NoJsz8KqDhQIgc7SnD+teCWuO9cuFF75ytsQJL9tKoNauF3wL7nRLH0o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":621478},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"}},"gitHead":"799c84d8b142575056659c90b0e3940c28e449cb","scripts":{"dev":"tsup --watch","build":"tsup","upload":"npm publish --access public","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.1.1_1760838250792_0.4880962233389601","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@benbraide/auth-service-nextjs","version":"1.2.0","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.2.0","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"13781baf711524e16148f3d43a9476e0148c0467","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.2.0.tgz","fileCount":22,"integrity":"sha512-sEUhFIZD2Gvcp+jDs6gh1oVPvz59pGJC63roMCe0HkD+YiOdSDzpWwQhUa7I9oJ7xIGHanh6YT2GjklB7g+idA==","signatures":[{"sig":"MEQCIBz7lYdEjZpdQfLsWQfTGFOIS5jGL1w/T9SdPqY25OZLAiBS+Mn8ojjI3ezU6FFMNx0zY9P7OkoA2CKttTB50CbzBg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":628220},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"}},"gitHead":"63200b7bf0c2758adee37ec248072ffbb5324901","scripts":{"dev":"tsup --watch","build":"tsup","upload":"npm publish --access public","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.2.0_1768079267576_0.6618519105723037","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@benbraide/auth-service-nextjs","version":"1.0.1","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.0.1","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"e291788b3a16cd002b53b922740e6aa267a04eb8","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.0.1.tgz","fileCount":22,"integrity":"sha512-OWvj1tCKaAIAWZM5t14AcJpdoVrnhDMaBWVZCSmEPfEUKfg4+xzLvwUw+xchSxkgyaEvWL8DCvKvDY+/uho6qQ==","signatures":[{"sig":"MEYCIQDESz1yI093S1FMM+wUJv9CakjwjHisxTfiW7n3NS5FFgIhAMEvDAByw/wKypbtmJp9BEEcPx5dThDv2FfX8s/2U7eI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":616974},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"}},"gitHead":"799c84d8b142575056659c90b0e3940c28e449cb","scripts":{"dev":"tsup --watch","build":"tsup","upload":"npm publish --access public","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.0.1_1768344561049_0.6022590436770034","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"name":"@benbraide/auth-service-nextjs","version":"1.3.1","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.3.1","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"70d3e86f681fcb0646fe54dce21f51ce7cdebe7b","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.3.1.tgz","fileCount":30,"integrity":"sha512-a7oBKpVMy3TofK5ElScD86r3QBHy8BpD//FDZDtcS2KDruo7Mkzqx9TzV7M1XxB2fIRVwXm7HisH8uZD5HvG7A==","signatures":[{"sig":"MEQCICGp1bG6XWwimnKGSUhCMG2zqEefeFuptrbNs+dQRv4JAiBoFxyrmkXlBKxC3LLxI/7Am6q8157SeNmBwOTv2SzM1g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":814968},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./sharing":{"types":"./dist/sharing/index.d.ts","import":"./dist/sharing/index.mjs","require":"./dist/sharing/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"}},"gitHead":"3e46e91599d49979dec86c36b30a75fff156df19","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","upload":"npm publish --access public","test:watch":"vitest","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.18","tsup":"^8.3.5","jsdom":"^29.1.1","react":"^18.3.1","vitest":"^4.1.7","react-dom":"^18.3.1","typescript":"^5.7.2","@types/node":"^25.9.1","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@vitest/coverage-v8":"^4.1.7","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2"},"peerDependencies":{"next":"^13.0.0 || ^14.0.0 || ^15.0.0","react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.3.1_1779884773145_0.9432788214691525","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@benbraide/auth-service-nextjs","version":"1.4.0","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.4.0","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"662a82fa8397715ac31bb2d997dfce58e87ba604","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.4.0.tgz","fileCount":30,"integrity":"sha512-wDCAjIiLCxkZvTl3MBueoDOPam7wDQOelI+nQ4AuTpWPFhnLzf+OWRSitGL/GWVL4myxcWbHe6HaugQ6i8itHA==","signatures":[{"sig":"MEQCIC0LnA4hMcKfiTlb13ydSo0SAw+VUb0Uh0BVZf5+buiKAiBBF4Dt+fIz2j6eDTrHZWtjwSG+bEEscoaSjxN4L+Yg9A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":841568},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./sharing":{"types":"./dist/sharing/index.d.ts","import":"./dist/sharing/index.mjs","require":"./dist/sharing/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"}},"gitHead":"65c9acde2a084d1d65deb970c4a39b8c33b518ac","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","upload":"npm publish --access public","test:watch":"vitest","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.18","tsup":"^8.3.5","jsdom":"^29.1.1","react":"^18.3.1","vitest":"^4.1.7","react-dom":"^18.3.1","typescript":"^5.7.2","@types/node":"^25.9.1","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@vitest/coverage-v8":"^4.1.7","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2"},"peerDependencies":{"next":"^13.0.0 || ^14.0.0 || ^15.0.0","react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.4.0_1779966668711_0.05081641084158961","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@benbraide/auth-service-nextjs","version":"1.5.0","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","_id":"@benbraide/auth-service-nextjs@1.5.0","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"dist":{"shasum":"661e2783ed4facf4ccdc9e37c2e9993de05a662e","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.5.0.tgz","fileCount":36,"integrity":"sha512-+P2N9v0VutmjcJe8uUW/Epu1wnoaWTUbmM4Hoy9PqjaAj8U5Cf9yxAyw5+LDcoSomcEM0LKXPuV3mgo27Igebw==","signatures":[{"sig":"MEYCIQD5iijuLXPaW0ag1XNN9K+9LMDxP8I8uJG4xCCG9x0LhQIhAPJ5W++s0RJqEKICXQbOdOIthZt7AxScqWFf84/wtsmN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":905378},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./sharing":{"types":"./dist/sharing/index.d.ts","import":"./dist/sharing/index.mjs","require":"./dist/sharing/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"},"./sharing/server":{"types":"./dist/sharing/server.d.ts","import":"./dist/sharing/server.mjs","require":"./dist/sharing/server.js"}},"gitHead":"7cac8399af0dc3865e84421555baf57a34d0e701","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","upload":"npm publish --access public","test:watch":"vitest","type-check":"tsc --noEmit","prepublishOnly":"npm run type-check && npm run build"},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"repository":{"url":"git+https://github.com/benbraide/auth-service-nextjs.git","type":"git"},"_npmVersion":"10.9.3","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"next":"^15.5.18","tsup":"^8.3.5","jsdom":"^29.1.1","react":"^18.3.1","vitest":"^4.1.7","react-dom":"^18.3.1","typescript":"^5.7.2","@types/node":"^25.9.1","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@vitest/coverage-v8":"^4.1.7","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2"},"peerDependencies":{"next":"^13.0.0 || ^14.0.0 || ^15.0.0","react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/auth-service-nextjs_1.5.0_1780061832331_0.20266614238892844","host":"s3://npm-registry-packages-npm-production"}},"1.6.0":{"name":"@benbraide/auth-service-nextjs","version":"1.6.0","description":"Next.js/React component for integrating iframe-based account switcher with authentication service","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./components":{"types":"./dist/components/index.d.ts","import":"./dist/components/index.mjs","require":"./dist/components/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./sharing":{"types":"./dist/sharing/index.d.ts","import":"./dist/sharing/index.mjs","require":"./dist/sharing/index.js"},"./sharing/server":{"types":"./dist/sharing/server.d.ts","import":"./dist/sharing/server.mjs","require":"./dist/sharing/server.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","type-check":"tsc --noEmit","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run type-check && npm run build","upload":"npm publish --access public"},"keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"author":{"name":"Ben Braide"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/benbraide/auth-service-nextjs.git"},"peerDependencies":{"next":"^13.0.0 || ^14.0.0 || ^15.0.0","react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"next":{"optional":true}},"devDependencies":{"@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/node":"^25.9.1","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@vitest/coverage-v8":"^4.1.7","jsdom":"^29.1.1","next":"^15.5.18","react":"^18.3.1","react-dom":"^18.3.1","tsup":"^8.3.5","typescript":"^5.7.2","vitest":"^4.1.7"},"_id":"@benbraide/auth-service-nextjs@1.6.0","gitHead":"22ee4b7d4e24a8d780403f9db2ee9cd33061771a","bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"homepage":"https://github.com/benbraide/auth-service-nextjs#readme","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-f4/vm4/AEFyG3/YMsu+nkVif9hr/kzbQYUh2QGxE7no21Wn789gGRETgSJc250wwkmBFLplahW4p0oG2OfbOsQ==","shasum":"4fc105407e9e5a2986ddb0609d2f0f8159549b6e","tarball":"https://registry.npmjs.org/@benbraide/auth-service-nextjs/-/auth-service-nextjs-1.6.0.tgz","fileCount":34,"unpackedSize":957394,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHynxHoixPqF7YIaLX8bfZHK1/07/dLPc5SOZnu0hT8cAiEA+R/dBc0laFfQdTAubxRZ1zQ4OU/MWYckUwxEqVqFcK4="}]},"_npmUser":{"name":"benbraide","email":"benplaeska@gmail.com"},"directories":{},"maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-service-nextjs_1.6.0_1780325519624_0.9591216178203541"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-06T01:54:07.882Z","modified":"2026-06-01T14:51:59.908Z","1.0.0":"2025-10-06T01:54:08.165Z","1.1.0":"2025-10-15T19:51:56.670Z","1.1.1":"2025-10-19T01:44:11.011Z","1.2.0":"2026-01-10T21:07:47.713Z","1.0.1":"2026-01-13T22:49:21.232Z","1.3.1":"2026-05-27T12:26:13.374Z","1.4.0":"2026-05-28T11:11:09.014Z","1.5.0":"2026-05-29T13:37:12.554Z","1.6.0":"2026-06-01T14:51:59.800Z"},"bugs":{"url":"https://github.com/benbraide/auth-service-nextjs/issues"},"author":{"name":"Ben Braide"},"license":"MIT","homepage":"https://github.com/benbraide/auth-service-nextjs#readme","keywords":["nextjs","react","authentication","account-switcher","iframe","sso","auth-service"],"repository":{"type":"git","url":"git+https://github.com/benbraide/auth-service-nextjs.git"},"description":"Next.js/React component for integrating iframe-based account switcher with authentication service","maintainers":[{"name":"benbraide","email":"benplaeska@gmail.com"}],"readme":"# @benbraide/auth-service-nextjs\r\n\r\nNext.js/React component library for integrating iframe-based account switcher with authentication service.\r\n\r\n## Features\r\n\r\n✅ **Full TypeScript Support** - Complete type definitions for all components and hooks\r\n✅ **SSR Compatible** - Works seamlessly with Next.js server-side rendering\r\n✅ **Interactive Dialogs** - Built-in support for confirm, prompt, and alert dialogs\r\n✅ **Auto-Resize** - Iframe automatically adjusts height based on content\r\n✅ **Tree-Shakeable** - Modern ESM and CJS builds with optimized bundle size\r\n✅ **Zero Dependencies** - Only peer dependencies on React 18+\r\n✅ **Cross-Product Handoff** - `@benbraide/auth-service-nextjs/sharing` ships the destination-side `/auth/handoff` route handler, landing page, multi-account auto-add primitive, and arrival toast. See [docs/sharing.md](docs/sharing.md).\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @benbraide/auth-service-nextjs\r\n```\r\n\r\n## Quick Start\r\n\r\n### 1. Wrap your app with `AccountSwitcherProvider`\r\n\r\n```typescript\r\n// app/layout.tsx\r\nimport { AccountSwitcherProvider } from '@benbraide/auth-service-nextjs';\r\n\r\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\r\n  return (\r\n    <html lang=\"en\">\r\n      <body>\r\n        <AccountSwitcherProvider\r\n          backendUrl={process.env.NEXT_PUBLIC_API_URL!}\r\n          authServiceUrl=\"https://auth.yourdomain.com\"\r\n          onSessionChange={(session) => {\r\n            console.log('Session changed:', session);\r\n          }}\r\n        >\r\n          {children}\r\n        </AccountSwitcherProvider>\r\n      </body>\r\n    </html>\r\n  );\r\n}\r\n```\r\n\r\n### 2. Use the `AccountSwitcher` component\r\n\r\n```typescript\r\n// components/Header.tsx\r\n'use client';\r\n\r\nimport { AccountSwitcher, useSession } from '@benbraide/auth-service-nextjs';\r\n\r\nexport function Header() {\r\n  const { currentUser, isAuthenticated } = useSession();\r\n\r\n  return (\r\n    <header className=\"flex items-center justify-between p-4\">\r\n      <h1>My App</h1>\r\n\r\n      {isAuthenticated && (\r\n        <div className=\"flex items-center gap-4\">\r\n          <span>Welcome, {currentUser?.name}!</span>\r\n          <AccountSwitcher />\r\n        </div>\r\n      )}\r\n    </header>\r\n  );\r\n}\r\n```\r\n\r\n### 3. Create API route for token generation\r\n\r\nThe package expects a `/api/account-switcher/token` endpoint that returns the widget token:\r\n\r\n```typescript\r\n// app/api/account-switcher/token/route.ts\r\nimport { NextResponse } from 'next/server';\r\n\r\nexport async function GET() {\r\n  try {\r\n    // Call your backend (Laravel/Node/etc.) to get the widget token\r\n    const response = await fetch(`${process.env.BACKEND_URL}/api/account-switcher/token`, {\r\n      headers: {\r\n        'Accept': 'application/json',\r\n      },\r\n      credentials: 'include',\r\n    });\r\n\r\n    const data = await response.json();\r\n\r\n    return NextResponse.json(data);\r\n  } catch (error) {\r\n    return NextResponse.json(\r\n      { error: 'Failed to fetch token' },\r\n      { status: 500 }\r\n    );\r\n  }\r\n}\r\n```\r\n\r\n## Components\r\n\r\n### `AccountSwitcherProvider`\r\n\r\nContext provider that manages session state and iframe communication.\r\n\r\n**Props:**\r\n\r\n```typescript\r\ninterface AccountSwitcherConfig {\r\n  backendUrl: string;                              // Required: Your backend API URL\r\n  authServiceUrl?: string;                         // Optional: Auth service URL\r\n  onSessionChange?: (session: Session) => void;    // Optional: Session change callback\r\n  onAccountChange?: (user: User) => void;          // Optional: Account change callback\r\n  onError?: (error: Error) => void;                // Optional: Error callback\r\n  debug?: boolean;                                 // Optional: Enable debug logging\r\n\r\n  // Dialog configuration\r\n  dialogs?: {\r\n    enabled?: boolean;                             // Default: true\r\n    closeOnOverlayClick?: boolean;                 // Default: true\r\n    closeOnEscape?: boolean;                       // Default: true\r\n  };\r\n\r\n  // Custom dialog handlers\r\n  onConfirmRequest?: (payload: ConfirmPayload) => Promise<boolean>;\r\n  onPromptRequest?: (payload: PromptPayload) => Promise<string | null>;\r\n  onAlertRequest?: (payload: AlertPayload) => Promise<void>;\r\n\r\n  // Auto-resize configuration\r\n  autoResize?: boolean;                            // Default: true\r\n  minHeight?: number;                              // Default: 200\r\n  maxHeight?: number | null;                       // Default: null (unlimited)\r\n  onResize?: (height: number) => void;             // Optional: Resize callback\r\n\r\n  // Navigation handlers (optional - default: window.location.href)\r\n  onNavigateToAddAccount?: (url: string) => void;     // Handle add account navigation\r\n  onNavigateToManageAccount?: (url: string) => void;  // Handle account management navigation\r\n  onNavigateToAvatarUpdate?: (url: string) => void;   // Handle avatar update navigation\r\n}\r\n```\r\n\r\n### `AccountAvatar`\r\n\r\nCompact, clickable avatar component for NAV bars that displays the current user's avatar and toggles the account switcher visibility.\r\n\r\n**Props:**\r\n\r\n```typescript\r\ninterface AccountAvatarProps {\r\n  size?: number;                                  // Avatar diameter in pixels (default: 40)\r\n  className?: string;                             // Additional CSS classes\r\n  style?: React.CSSProperties;                    // Custom inline styles\r\n  targetId?: string;                              // ID of element to toggle (IFRAME container)\r\n  onClick?: () => void;                           // Custom click handler\r\n  onAvatarClick?: (user: User | null) => void;   // Callback with user data on click\r\n}\r\n```\r\n\r\n**Features:**\r\n- Displays user avatar (image or initials) when logged in\r\n- Shows generic profile icon when logged out\r\n- Automatically syncs with session changes\r\n- Toggles target element visibility (typically IFRAME container)\r\n- Outside click and ESC key support for closing popup\r\n- Smooth hover and active animations\r\n\r\n**Example:**\r\n\r\n```typescript\r\n// In your NAV component\r\n'use client';\r\n\r\nimport { AccountAvatar } from '@benbraide/auth-service-nextjs';\r\n\r\nexport function Navbar() {\r\n  return (\r\n    <nav className=\"navbar\">\r\n      <div className=\"logo\">My App</div>\r\n\r\n      <div className=\"nav-items\">\r\n        {/* Avatar that toggles the dropdown */}\r\n        <AccountAvatar\r\n          size={40}\r\n          targetId=\"account-switcher-dropdown\"\r\n          onAvatarClick={(user) => console.log('Clicked:', user?.name)}\r\n        />\r\n      </div>\r\n    </nav>\r\n\r\n    {/* Hidden dropdown with AccountSwitcher */}\r\n    <div\r\n      id=\"account-switcher-dropdown\"\r\n      style={{\r\n        display: 'none',\r\n        position: 'absolute',\r\n        top: '60px',\r\n        right: '20px',\r\n        zIndex: 1000,\r\n      }}\r\n    >\r\n      <AccountSwitcher width={320} height={400} />\r\n    </div>\r\n  );\r\n}\r\n```\r\n\r\n### `AccountSwitcher`\r\n\r\nIframe component that displays the account switcher widget.\r\n\r\n**Props:**\r\n\r\n```typescript\r\ninterface AccountSwitcherProps {\r\n  className?: string;                             // Optional: CSS class\r\n  position?: 'top-left' | 'top-right' |          // Optional: Position\r\n             'bottom-left' | 'bottom-right';\r\n  width?: number;                                // Optional: Width in pixels\r\n  height?: number;                               // Optional: Height in pixels\r\n}\r\n```\r\n\r\n## Hooks\r\n\r\n### `useSession()`\r\n\r\nReturns current session state.\r\n\r\n```typescript\r\nconst {\r\n  isAuthenticated,\r\n  currentUser,\r\n  accounts,\r\n  isLoading,\r\n  error\r\n} = useSession();\r\n```\r\n\r\n### `useUser()`\r\n\r\nReturns current user object.\r\n\r\n```typescript\r\nconst user = useUser();\r\n```\r\n\r\n### `useAccountSwitcher()`\r\n\r\nReturns account switcher methods.\r\n\r\n```typescript\r\nconst {\r\n  switchAccount,\r\n  addAccount,\r\n  manageAccount,\r\n  updateAvatar,\r\n  logoutAccount,\r\n  logoutAll,\r\n  refresh\r\n} = useAccountSwitcher();\r\n\r\n// Switch to a different account\r\nawait switchAccount('user-uuid-here');\r\n\r\n// Add new account\r\nawait addAccount();\r\n\r\n// Navigate to account management page\r\nawait manageAccount();\r\n\r\n// Navigate to avatar update page\r\nawait updateAvatar();\r\n\r\n// Logout specific account\r\nawait logoutAccount('user-uuid');\r\n\r\n// Logout all accounts\r\nawait logoutAll();\r\n\r\n// Refresh session\r\nawait refresh();\r\n```\r\n\r\n## Advanced Usage\r\n\r\n### Custom Dialog Handlers\r\n\r\nUse your own UI library (e.g., SweetAlert2, Radix UI):\r\n\r\n```typescript\r\n<AccountSwitcherProvider\r\n  backendUrl={process.env.NEXT_PUBLIC_API_URL!}\r\n  onConfirmRequest={async (payload) => {\r\n    const result = await Swal.fire({\r\n      title: payload.title,\r\n      text: payload.message,\r\n      icon: payload.variant === 'danger' ? 'warning' : 'question',\r\n      showCancelButton: true,\r\n      confirmButtonText: payload.confirmText || 'OK',\r\n    });\r\n    return result.isConfirmed;\r\n  }}\r\n>\r\n  {children}\r\n</AccountSwitcherProvider>\r\n```\r\n\r\n### Event Handlers\r\n\r\n```typescript\r\n<AccountSwitcherProvider\r\n  backendUrl={process.env.NEXT_PUBLIC_API_URL!}\r\n  onSessionChange={(session) => {\r\n    if (session.isAuthenticated) {\r\n      // Load user data\r\n      fetchUserData(session.currentUser.uuid);\r\n    }\r\n  }}\r\n  onAccountChange={(user) => {\r\n    // Reload page or refresh data\r\n    window.location.reload();\r\n  }}\r\n  onError={(error) => {\r\n    toast.error(error.message);\r\n  }}\r\n>\r\n  {children}\r\n</AccountSwitcherProvider>\r\n```\r\n\r\n### Custom Navigation Handlers\r\n\r\nOverride default navigation behavior for account flows:\r\n\r\n```typescript\r\n<AccountSwitcherProvider\r\n  backendUrl={process.env.NEXT_PUBLIC_API_URL!}\r\n  onNavigateToAddAccount={(url) => {\r\n    // Use Next.js router instead of window.location\r\n    router.push(url);\r\n  }}\r\n  onNavigateToManageAccount={(url) => {\r\n    // Open in new tab\r\n    window.open(url, '_blank');\r\n  }}\r\n  onNavigateToAvatarUpdate={(url) => {\r\n    // Custom modal implementation\r\n    openAvatarModal(url);\r\n  }}\r\n>\r\n  {children}\r\n</AccountSwitcherProvider>\r\n```\r\n\r\n### Debug Mode\r\n\r\nEnable verbose logging:\r\n\r\n```typescript\r\n<AccountSwitcherProvider\r\n  backendUrl={process.env.NEXT_PUBLIC_API_URL!}\r\n  debug={process.env.NODE_ENV === 'development'}\r\n>\r\n  {children}\r\n</AccountSwitcherProvider>\r\n```\r\n\r\n## TypeScript Types\r\n\r\n```typescript\r\ninterface User {\r\n  uuid: string;\r\n  name: string;\r\n  email: string;\r\n  avatar_url?: string;\r\n  created_at?: string;\r\n}\r\n\r\ninterface Session {\r\n  isAuthenticated: boolean;\r\n  currentUser: User | null;\r\n  accounts: User[];\r\n}\r\n```\r\n\r\n## Backend Integration\r\n\r\nYour backend should implement these endpoints:\r\n\r\n### `GET /api/account-switcher/token`\r\n\r\nGenerate widget embed token.\r\n\r\n**Response:**\r\n```json\r\n{\r\n  \"token\": \"eyJ...\",\r\n  \"embed_url\": \"https://auth.example.com/widgets/embed?token=eyJ...\",\r\n  \"expires_at\": \"2025-10-02 01:30:00\"\r\n}\r\n```\r\n\r\n### `POST /api/account-switcher/sync-session` (Optional)\r\n\r\nSync session after account switch.\r\n\r\n**Request:**\r\n```json\r\n{\r\n  \"auth_token\": \"eyJ...\",\r\n  \"user_uuid\": \"user-uuid\"\r\n}\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Author\r\n\r\nBen Braide\r\n","readmeFilename":"README.md"}