{"_id":"@bigio/better-auth-electron","_rev":"6-c832ce8c511e351387c210dcb9319ee0","name":"@bigio/better-auth-electron","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@bigio/better-auth-electron","version":"1.0.0","author":{"name":"bigmusic"},"license":"MIT","_id":"@bigio/better-auth-electron@1.0.0","maintainers":[{"name":"bigmusic","email":"music.big@gmail.com"}],"homepage":"https://github.com/bigmusic/better-auth-electron#readme","bugs":{"url":"https://github.com/bigmusic/better-auth-electron/issues"},"dist":{"shasum":"8901e27c84581d8705714080b5ab8ac7c899eaae","tarball":"https://registry.npmjs.org/@bigio/better-auth-electron/-/better-auth-electron-1.0.0.tgz","fileCount":18,"integrity":"sha512-Ii/CLx8KIzbm6+W635u1tGEhiKWZ02oYHNSedq5qiToPeCObD0DsYBKcnk8baHG2wevCRjEX+42yhL+hy9UM6Q==","signatures":[{"sig":"MEUCIQDrXorRorswzYjtGMF5T4aR3zucz3o/1fPUqIszMa6yNQIgSxdrlNGnkLByD4UaFzPLHLYtD1AR1BZGv5v7Xpe4d5s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6424975},"type":"module","_from":"file:bigio-better-auth-electron-1.0.0.tgz","exports":{"./web":{"types":"./dist/web.d.ts","import":"./dist/web.js"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"},"./options":{"types":"./dist/options.d.ts","import":"./dist/options.js"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.js"},"./package.json":"./package.json"},"private":false,"scripts":{"_dev":"tsup --watch","lint":"biome check .","push":"pnpm build && yalc publish --push","build":"tsup","clean":"rm -rf node_modules","format":"biome check --write .","dev:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --sourcemap=inline --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact --watch","typecheck":"tsc --noEmit","build:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --minify --sourcemap --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact"},"_npmUser":{"name":"bigmusic","email":"music.big@gmail.com"},"_resolved":"/private/var/folders/gr/_xmc24510270nwddw_61rmmw0000gn/T/90f89d7d1e6a70726dddd675721c8a6e/bigio-better-auth-electron-1.0.0.tgz","_integrity":"sha512-Ii/CLx8KIzbm6+W635u1tGEhiKWZ02oYHNSedq5qiToPeCObD0DsYBKcnk8baHG2wevCRjEX+42yhL+hy9UM6Q==","repository":{"url":"git+https://github.com/bigmusic/better-auth-electron.git","type":"git"},"_npmVersion":"11.6.2","description":"A type-safe, IPC-based Better Auth integration for Electron, featuring strict process isolation and secure authentication flows.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^4.3.6","jotai":"^2.17.1","nanostores":"^1.1.0","electron-log":"^5.4.3","@oslojs/encoding":"^1.1.0","@nanostores/react":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","preact":"^10.28.3","esbuild":"^0.27.2","electron":"^39.5.1","typescript":"^5.9.3","@types/node":"^25.2.0","better-auth":"^1.4.18","@types/react":"^19.2.11","@biomejs/biome":"^2.3.14","@types/react-dom":"^19.2.3","preact-render-to-string":"^6.6.5"},"peerDependencies":{"react":"^19","preact":">10","electron":"^39","react-dom":"^19","better-auth":">1"},"peerDependenciesMeta":{"preact":{"optional":true},"electron":{"optional":false},"better-auth":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/better-auth-electron_1.0.0_1770249603959_0.9286058438767129","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bigio/better-auth-electron","version":"1.0.1","author":{"name":"bigmusic"},"license":"MIT","_id":"@bigio/better-auth-electron@1.0.1","maintainers":[{"name":"bigmusic","email":"music.big@gmail.com"}],"homepage":"https://github.com/bigmusic/better-auth-electron#readme","bugs":{"url":"https://github.com/bigmusic/better-auth-electron/issues"},"dist":{"shasum":"fbd59b6b38eff0af9966297fe16ccabd0342ce0e","tarball":"https://registry.npmjs.org/@bigio/better-auth-electron/-/better-auth-electron-1.0.1.tgz","fileCount":18,"integrity":"sha512-VNs+98O4FLuxvuUCntGk99FQLjsoeHEaEHlxHLbFhpB0ouP159LJrYzW2vdegRLYpVciiH0QH6EnDH8fGg5f0g==","signatures":[{"sig":"MEUCID9jvwPsS69HSsgD5mnG7do57y5bEqSK3xM6S9ndd90/AiEAyGprfKcj97W3z0l06ruQhmtts4yQ3JjPGy8Mkp1JF9o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6426000},"type":"module","_from":"file:bigio-better-auth-electron-1.0.1.tgz","exports":{"./web":{"types":"./dist/web.d.ts","import":"./dist/web.js"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"},"./options":{"types":"./dist/options.d.ts","import":"./dist/options.js"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.js"},"./package.json":"./package.json"},"private":false,"scripts":{"_dev":"tsup --watch","lint":"biome check .","push":"pnpm build && yalc publish --push","build":"tsup","clean":"rm -rf node_modules","format":"biome check --write .","dev:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --sourcemap=inline --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact --watch","typecheck":"tsc --noEmit","build:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --minify --sourcemap --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact"},"_npmUser":{"name":"bigmusic","email":"music.big@gmail.com"},"_resolved":"/private/var/folders/gr/_xmc24510270nwddw_61rmmw0000gn/T/795a95734457c2d38f915c305cb3a24c/bigio-better-auth-electron-1.0.1.tgz","_integrity":"sha512-VNs+98O4FLuxvuUCntGk99FQLjsoeHEaEHlxHLbFhpB0ouP159LJrYzW2vdegRLYpVciiH0QH6EnDH8fGg5f0g==","repository":{"url":"git+https://github.com/bigmusic/better-auth-electron.git","type":"git"},"_npmVersion":"11.6.2","description":"A type-safe, IPC-based Better Auth integration for Electron, featuring strict process isolation and secure authentication flows.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^4.3.6","jotai":"^2.17.1","nanostores":"^1.1.0","electron-log":"^5.4.3","@oslojs/encoding":"^1.1.0","@nanostores/react":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","preact":"^10.28.3","esbuild":"^0.27.2","electron":"^39.5.1","typescript":"^5.9.3","@types/node":"^25.2.0","better-auth":"^1.4.18","@types/react":"^19.2.11","@biomejs/biome":"^2.3.14","@types/react-dom":"^19.2.3","preact-render-to-string":"^6.6.5"},"peerDependencies":{"react":"^19","preact":">10","electron":"^39","react-dom":"^19","better-auth":">1"},"peerDependenciesMeta":{"preact":{"optional":true},"electron":{"optional":false},"better-auth":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/better-auth-electron_1.0.1_1770254025567_0.10003185524748948","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bigio/better-auth-electron","version":"1.0.2","author":{"name":"bigmusic"},"license":"MIT","_id":"@bigio/better-auth-electron@1.0.2","maintainers":[{"name":"bigmusic","email":"music.big@gmail.com"}],"homepage":"https://github.com/bigmusic/better-auth-electron#readme","bugs":{"url":"https://github.com/bigmusic/better-auth-electron/issues"},"dist":{"shasum":"6fbdba36739ca0d0a65790a2d2ff7bf38bc4473f","tarball":"https://registry.npmjs.org/@bigio/better-auth-electron/-/better-auth-electron-1.0.2.tgz","fileCount":19,"integrity":"sha512-SHeVuflpPyfr+c/43eRqBS9y7UuhafMsKmh/dcb1eI/wSwtwVCpN6uBl204aCE6BoxC4/4OnnBbOHdCZDeJjtA==","signatures":[{"sig":"MEQCIC83gnuVBWgg3kzBuQCr74NQNCmX3AGH+g0ueoExawV/AiAD4L6hM0cqCkeXCddxaXXAM6wb9pXslAa2TX21XRGy6g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":585120},"type":"module","_from":"file:bigio-better-auth-electron-1.0.2.tgz","exports":{"./web":{"types":"./dist/web.d.ts","import":"./dist/web.js"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"},"./options":{"types":"./dist/options.d.ts","import":"./dist/options.js"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.js"},"./package.json":"./package.json"},"private":false,"scripts":{"_dev":"tsup --watch","lint":"biome check .","push":"pnpm build && yalc publish --push","build":"tsup","clean":"rm -rf node_modules","format":"biome check --write .","dev:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --sourcemap=inline --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact --watch","typecheck":"tsc --noEmit","build:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --minify --sourcemap --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact"},"_npmUser":{"name":"bigmusic","email":"music.big@gmail.com"},"_resolved":"/private/var/folders/gr/_xmc24510270nwddw_61rmmw0000gn/T/f6e1aa00895724bff7a451e3fbdd4551/bigio-better-auth-electron-1.0.2.tgz","_integrity":"sha512-SHeVuflpPyfr+c/43eRqBS9y7UuhafMsKmh/dcb1eI/wSwtwVCpN6uBl204aCE6BoxC4/4OnnBbOHdCZDeJjtA==","repository":{"url":"git+https://github.com/bigmusic/better-auth-electron.git","type":"git"},"_npmVersion":"11.6.2","description":"A type-safe, IPC-based Better Auth integration for Electron, featuring strict process isolation and secure authentication flows.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"nanostores":"^1.1.0","electron-log":"^5.4.3","@oslojs/encoding":"^1.1.0","@nanostores/react":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","zod":"^4.3.6","tsup":"^8.5.1","preact":"^10.28.3","esbuild":"^0.27.2","electron":"^39.5.1","typescript":"^5.9.3","@types/node":"^25.2.0","better-auth":"^1.4.18","@types/react":"^19.2.11","@biomejs/biome":"^2.3.14","@types/react-dom":"^19.2.3","preact-render-to-string":"^6.6.5"},"peerDependencies":{"zod":"^4","react":"^19","preact":">10","electron":"^39","react-dom":"^19","better-auth":">1"},"peerDependenciesMeta":{"preact":{"optional":true},"electron":{"optional":false},"better-auth":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/better-auth-electron_1.0.2_1770575789525_0.90129363038677","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bigio/better-auth-electron","version":"1.0.3","author":{"name":"bigmusic"},"license":"MIT","_id":"@bigio/better-auth-electron@1.0.3","maintainers":[{"name":"bigmusic","email":"music.big@gmail.com"}],"homepage":"https://github.com/bigmusic/better-auth-electron#readme","bugs":{"url":"https://github.com/bigmusic/better-auth-electron/issues"},"dist":{"shasum":"e7f0b04f16618038f38e0139a68b7b3fb98a1928","tarball":"https://registry.npmjs.org/@bigio/better-auth-electron/-/better-auth-electron-1.0.3.tgz","fileCount":19,"integrity":"sha512-+71qRIfjIN458PW5UKGhSrxoHFXPLtEbvl8bgx3VQphMDkMEy613vmYjjJSQ4YqsP6JIQ/JL2DcJ1QUsakONyQ==","signatures":[{"sig":"MEQCICYGrqq8w1wl88IuLuWIqNWUE4pSZ3zRtqT485Q/nWXfAiBZ5C80l96eMl6H/UhIFQNFn/xFCsAq88mOCnJnyjtqQw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":802722},"type":"module","_from":"file:bigio-better-auth-electron-1.0.3.tgz","exports":{"./web":{"types":"./dist/web.d.ts","import":"./dist/web.js"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"},"./options":{"types":"./dist/options.d.ts","import":"./dist/options.js"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.js"},"./package.json":"./package.json"},"private":false,"scripts":{"_dev":"tsup --watch","lint":"biome check .","push":"pnpm build && yalc publish --push","build":"tsup","clean":"rm -rf node_modules","format":"biome check --write .","dev:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --sourcemap=inline --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact --watch","typecheck":"tsc --noEmit","build:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --minify --sourcemap --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact"},"_npmUser":{"name":"bigmusic","email":"music.big@gmail.com"},"_resolved":"/private/var/folders/gr/_xmc24510270nwddw_61rmmw0000gn/T/5e8cecc54dda9287c1bf6964abda73b6/bigio-better-auth-electron-1.0.3.tgz","_integrity":"sha512-+71qRIfjIN458PW5UKGhSrxoHFXPLtEbvl8bgx3VQphMDkMEy613vmYjjJSQ4YqsP6JIQ/JL2DcJ1QUsakONyQ==","repository":{"url":"git+https://github.com/bigmusic/better-auth-electron.git","type":"git"},"_npmVersion":"11.6.2","description":"A type-safe, IPC-based Better Auth integration for Electron, featuring strict process isolation and secure authentication flows.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"nanostores":"^1.1.0","electron-log":"^5.4.3","@oslojs/encoding":"^1.1.0","@nanostores/react":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","zod":"^4.3.6","tsup":"^8.5.1","preact":"^10.28.3","esbuild":"^0.27.2","electron":"^39.5.1","typescript":"^5.9.3","@types/node":"^25.2.0","better-auth":"^1.4.18","@types/react":"^19.2.11","@biomejs/biome":"^2.3.14","@types/react-dom":"^19.2.3","preact-render-to-string":"^6.6.5"},"peerDependencies":{"zod":"^4","react":"^19","preact":">10","electron":"^39","react-dom":"^19","better-auth":">1"},"peerDependenciesMeta":{"preact":{"optional":true},"electron":{"optional":false},"better-auth":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/better-auth-electron_1.0.3_1770589790978_0.03936313124404056","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@bigio/better-auth-electron","version":"1.0.4","author":{"name":"bigmusic"},"license":"MIT","_id":"@bigio/better-auth-electron@1.0.4","maintainers":[{"name":"bigmusic","email":"music.big@gmail.com"}],"homepage":"https://github.com/bigmusic/better-auth-electron#readme","bugs":{"url":"https://github.com/bigmusic/better-auth-electron/issues"},"dist":{"shasum":"236b41bf39bb50b3add41958efebacfb465a13f2","tarball":"https://registry.npmjs.org/@bigio/better-auth-electron/-/better-auth-electron-1.0.4.tgz","fileCount":19,"integrity":"sha512-wgMyqFTwPMXnL54B8lsT9tJe8vDQlnPPv8E/MgjkVUFCnf1HXSWUfhWrU2GLuLBSvrfhhY7tzT6LSUwYDGmysg==","signatures":[{"sig":"MEQCIFOnmtdCR3bGApnRx6a77rfRqMCljCFsSuwmCIin1ZORAiANjuG0IqfFDJF128FISv49VEzdJT8R2Rdm1+6GJBE8Pw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":795669},"type":"module","_from":"file:bigio-better-auth-electron-1.0.4.tgz","exports":{"./web":{"types":"./dist/web.d.ts","import":"./dist/web.js"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"},"./options":{"types":"./dist/options.d.ts","import":"./dist/options.js"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.js"},"./package.json":"./package.json"},"private":false,"scripts":{"_dev":"tsup --watch","lint":"biome check .","push":"pnpm build && yalc publish --push","build":"tsup","clean":"rm -rf node_modules","format":"biome check --write .","dev:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --sourcemap=inline --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact --watch","typecheck":"tsc --noEmit","build:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --minify --sourcemap --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact"},"_npmUser":{"name":"bigmusic","email":"music.big@gmail.com"},"_resolved":"/private/var/folders/gr/_xmc24510270nwddw_61rmmw0000gn/T/a804bc307c857b2024e4df39f428f72c/bigio-better-auth-electron-1.0.4.tgz","_integrity":"sha512-wgMyqFTwPMXnL54B8lsT9tJe8vDQlnPPv8E/MgjkVUFCnf1HXSWUfhWrU2GLuLBSvrfhhY7tzT6LSUwYDGmysg==","repository":{"url":"git+https://github.com/bigmusic/better-auth-electron.git","type":"git"},"_npmVersion":"11.6.2","description":"A type-safe, IPC-based Better Auth integration for Electron, featuring strict process isolation and secure authentication flows.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"nanostores":"^1.1.0","electron-log":"^5.4.3","@oslojs/encoding":"^1.1.0","@nanostores/react":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","zod":"^4.3.6","tsup":"^8.5.1","preact":"^10.28.3","esbuild":"^0.27.2","electron":"^39.5.1","typescript":"^5.9.3","@types/node":"^25.2.0","better-auth":"^1.4.18","@types/react":"^19.2.11","@biomejs/biome":"^2.3.14","@types/react-dom":"^19.2.3","preact-render-to-string":"^6.6.5"},"peerDependencies":{"zod":"^4","react":"^19","preact":">10","electron":"^39","react-dom":"^19","better-auth":">1"},"peerDependenciesMeta":{"preact":{"optional":true},"electron":{"optional":false},"better-auth":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/better-auth-electron_1.0.4_1770674455993_0.2981664890332314","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@bigio/better-auth-electron","version":"1.0.5","author":{"name":"bigmusic"},"license":"MIT","private":false,"description":"A type-safe, IPC-based Better Auth integration for Electron, featuring strict process isolation and secure authentication flows.","repository":{"type":"git","url":"git+https://github.com/bigmusic/better-auth-electron.git"},"type":"module","dependencies":{"@nanostores/react":"^1.0.0","@oslojs/encoding":"^1.1.0","electron-log":"^5.4.3","nanostores":"^1.1.0"},"devDependencies":{"@biomejs/biome":"^2.3.14","@types/node":"^25.2.0","@types/react":"^19.2.11","@types/react-dom":"^19.2.3","better-auth":"^1.4.18","electron":"^39.5.1","esbuild":"^0.27.2","preact":"^10.28.3","preact-render-to-string":"^6.6.5","tsup":"^8.5.1","tsx":"^4.21.0","typescript":"^5.9.3","zod":"^4.3.6"},"peerDependenciesMeta":{"preact":{"optional":true},"electron":{"optional":false},"better-auth":{"optional":false}},"peerDependencies":{"better-auth":">1","electron":"^39","preact":">10","react":"^19","react-dom":"^19","zod":"^4"},"exports":{"./web":{"types":"./dist/web.d.ts","import":"./dist/web.js"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.js"},"./options":{"types":"./dist/options.d.ts","import":"./dist/options.js"},"./package.json":"./package.json"},"scripts":{"push":"pnpm build && yalc publish --push","build":"tsup","_dev":"tsup --watch","typecheck":"tsc --noEmit","clean":"rm -rf node_modules","lint":"biome check .","format":"biome check --write .","build:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --minify --sourcemap --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact","dev:login":"esbuild src/preact/better-auth/electron-preact-oauth.tsx --bundle --sourcemap=inline --format=esm --outfile=dist/preact-electron-login.js --jsx-import-source=preact --watch"},"_id":"@bigio/better-auth-electron@1.0.5","bugs":{"url":"https://github.com/bigmusic/better-auth-electron/issues"},"homepage":"https://github.com/bigmusic/better-auth-electron#readme","_integrity":"sha512-/RZmIFANj0C2vZbnfZlrSgaWBSR68nEA7c7mN2B6SF6lmja9sNBQiurSqOKLvsB0RwOUfSOEp92YlrcTW1fsvg==","_resolved":"/private/var/folders/gr/_xmc24510270nwddw_61rmmw0000gn/T/e5579dcca359315c5684801c6217aa00/bigio-better-auth-electron-1.0.5.tgz","_from":"file:bigio-better-auth-electron-1.0.5.tgz","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-/RZmIFANj0C2vZbnfZlrSgaWBSR68nEA7c7mN2B6SF6lmja9sNBQiurSqOKLvsB0RwOUfSOEp92YlrcTW1fsvg==","shasum":"ded311075e3f9a8906aa7d1a823712ceaa8f162d","tarball":"https://registry.npmjs.org/@bigio/better-auth-electron/-/better-auth-electron-1.0.5.tgz","fileCount":19,"unpackedSize":863034,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC7cPC+WpE/nFUFYBSIlog+/rm7WEHwEIlxzoTUDXrzVAiEA/pQZWn+34BiUSnRDhrPXpVwe6P4ay6g9oB0QZBy8F7M="}]},"_npmUser":{"name":"bigmusic","email":"music.big@gmail.com"},"directories":{},"maintainers":[{"name":"bigmusic","email":"music.big@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/better-auth-electron_1.0.5_1771036490044_0.614896754450726"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-05T00:00:03.893Z","modified":"2026-02-14T02:34:50.389Z","1.0.0":"2026-02-05T00:00:04.183Z","1.0.1":"2026-02-05T01:13:45.775Z","1.0.2":"2026-02-08T18:36:29.691Z","1.0.3":"2026-02-08T22:29:51.159Z","1.0.4":"2026-02-09T22:00:56.229Z","1.0.5":"2026-02-14T02:34:50.251Z"},"bugs":{"url":"https://github.com/bigmusic/better-auth-electron/issues"},"author":{"name":"bigmusic"},"license":"MIT","homepage":"https://github.com/bigmusic/better-auth-electron#readme","repository":{"type":"git","url":"git+https://github.com/bigmusic/better-auth-electron.git"},"description":"A type-safe, IPC-based Better Auth integration for Electron, featuring strict process isolation and secure authentication flows.","maintainers":[{"name":"bigmusic","email":"music.big@gmail.com"}],"readme":"# @bigio/better-auth-electron\n\nThis plugin establishes a secure, **event-driven** authentication bridge between Electron and Better Auth. It treats the system browser strictly as a **stateless transport layer**, utilizing **AES-encrypted tickets** and **PKCE verification** to perform session handoff without persisting web cookies in the desktop environment.\n\nThe renderer implementation abandons traditional redirect handling in favor of an IPC-based subscription model (`onDeepLink*`). It features a built-in **cold-start buffer** to guarantee token capture even if the deep link triggers the application before the UI is fully mounted. The API surface is designed to mirror the official Better Auth client patterns, ensuring strict typing and zero-friction integration.\n\n### Key Architecture\n\n- **Stateless Web Handoff**: The browser authenticates via OAuth but does not share the session with Electron. It passes an encrypted, time-limited ticket back to the desktop app.\n- **Security**: Full PKCE flow (Proof Key for Code Exchange) with verified challenges and AES-encrypted exchange tickets.\n- **Event-Driven Renderer**: No page reloads or router redirects. Listen for `onDeepLinkSuccess`, `onDeepLinkNewUser`, or `onDeepLinkFailed` directly within your React/Vue components.\n- **Cold Start Support**: Includes an internal IPC buffer to cache deep link events that occur during the application boot phase, ensuring no authentication intent is lost while the renderer initializes.\n- **API Parity**: Extends the `authClient` with a `bigio` namespace that mimics standard Better Auth methods (e.g., `signInSocial`).\n- **Native Secure Context & Origin Fix:** Leverages `protocol.registerSchemesAsPrivileged` to treat your custom scheme as a secure context. This solves the infamous `Origin` header mismatch and enables `SameSite` cookies to work natively without hacks.\n\n#### _I'm currently studying the official implementation; the documentation is still rough but will be improved soon. I'm eager and looking forward to exchanging ideas with everyone._\n\n# Authentication Flow\n\nThe following diagram illustrates the complete OAuth authorization and session handoff process, including the interaction with external **OAuth Providers** (e.g., GitHub, Google):\n\n```mermaid\nsequenceDiagram\n    participant User as User\n    participant E_R as Electron Renderer\n    participant E_M as Electron Main\n    participant Browser as External Browser (Web Frontend)\n    participant Server as Auth Server (Better Auth)\n    participant Provider as OAuth Provider (GitHub/Google)\n\n    Note over E_R, E_M: 1. Initialization & Startup\n    E_R->>E_M: Send App Mounted Signal\n    User->>E_R: Click Login\n    E_R->>E_R: Click Login (window.open)\n    E_M->>E_M: Intercept Request, Generate PKCE Verifier\n    E_M->>Browser: Open External Browser (with Challenge)\n\n    Note over Browser, Provider: 2. Web Handoff Decision & OAuth Flow\n    alt Session Exists\n        Browser->>Browser: Detect Active Session\n        Browser->>User: Show \"Continue as [User]\" or \"Switch Account\"\n        alt User selects \"Fast Login\"\n            User->>Browser: Click \"Continue as [User]\"\n            Browser->>Server: Request Fast Ticket (POST /fast-ticket)\n            Server->>Server: Generate Encrypted Ticket\n            Server-->>Browser: Return Redirect URL (bigio://...)\n        else User selects \"Switch Account\"\n            User->>Browser: Click \"Switch Account\"\n            Browser->>Server: Initiate OAuth (signIn.social)\n            Server->>Provider: Redirect to Provider Login\n            Provider->>User: Prompt for Credentials\n            User->>Provider: Authorize App\n            Provider-->>Server: Callback with Code/Token\n            Note right of Server: Stateless: Set-Cookie is intercepted/removed\n            Server->>Server: Auth Success, Generate Encrypted Ticket\n            Server-->>Browser: Redirect to bigio://callback?ticket=...\n        end\n    else No Session\n        User->>Browser: Select Provider\n        Browser->>Server: Initiate OAuth (signIn.social)\n        Server->>Provider: Redirect to Provider Login\n        Provider->>User: Prompt for Credentials\n        User->>Provider: Authorize App\n        Provider-->>Server: Callback with Code/Token\n        Note right of Server: Stateless: Set-Cookie is intercepted/removed\n        Server->>Server: Auth Success, Generate Encrypted Ticket\n        Server-->>Browser: Redirect to bigio://callback?ticket=...\n    end\n\n    Note over Browser, E_R: 3. Session Handoff\n    Browser->>E_M: Trigger Deep Link (Custom Protocol)\n    E_M->>E_R: Send Ticket & Verifier via IPC\n    E_R->>E_R: Verify PKCE Challenge\n    E_R->>Server: POST /exchange-ticket (Ticket + Verifier)\n    Server->>Server: Decrypt Ticket, Verify PKCE\n    Server->>Server: Create Electron-specific Session\n    Server-->>E_R: Return Session Cookie (SameSite=None)\n    E_R->>E_R: Login Success, Refresh UI\n```\n\nBased on my study of the official implementation code, I have decided on the following to-do list:\n\n**~~1. Architecture: The \"Silent Handoff\" (Stateless & Secure)~~**\n\n- [done] ~~**Server-Side Cookie Interception**: Modify `electron-server-plugin` to intercept the OAuth callback response.~~\n- ~~_Action_: Strip the `Set-Cookie` header (specifically the session token) from the response to prevent overwriting the user's browser session.~~\n- ~~_Goal_: Achieve strict physical isolation between Web Session and Electron Session.~~\n\n- ~~**Stateless OAuth Flow**: Ensure the OAuth flow relies solely on the encrypted `Ticket` mechanism, making the browser a purely stateless transport layer for Electron authentication.~~\n\n**2. Security & Hardening**\n\n- [ ] **Secure Persistence**: Implement `safeStorage` (DPAPI/Keychain) for encrypting the persisted PKCE Verifier on disk.\n- _Reason_: Prevent plaintext credentials from resting on the file system.\n\n- [ ] **User-Agent Scrubbing**: Global removal of \"Electron\" tokens from the `User-Agent` string at the `app.on('ready')` stage.\n- _Reason_: Bypass WAF/Anti-Bot protections that block Electron-based requests during the ticket exchange phase.\n\n- [done] ~~**Automated CSP Injection**: Implement `onHeadersReceived` interceptor in the Main Process.~~\n  - ~~_Action_: Automatically append the backend API URL to the `connect-src` directive.~~\n  - ~~_Goal_: Provide a \"Zero-Config\" experience by preventing CSP violations without requiring users to manually edit `index.html`.~~\n\n**3. Developer Experience (DX) & API**\n\n- [done] ~~**Enhanced Renderer API**: Refactor `getActions` to introduce a dedicated `authClient.bigio` namespace.~~\n- ~~_Feature_: Implement `authClient.bigio.signIn({ provider: 'github' })` wrapper.~~\n- ~~_Implementation_: Utilize `window.open` (intercepted by Main) or IPC to trigger the flow, keeping the API consistent with the official web client style.~~\n\n- [done] ~~**Smart Web Handoff UI (Optional/Next)**: Update the web-side confirmation page to detect and display the currently logged-in web user, offering a \"Continue as [User]\" button for a seamless transition.~~\n\n# Installation\n\n```bash\npnpm add @bigio/better-auth-electron\n```\n\nEnsure peer dependencies are installed:(more framework support coming soon...)\n\n```bash\npnpm add better-auth electron react react-dom\n```\n\n# Quick Start\n\n### 1. Server Setup (`src/lib/auth.ts`)\n\nInitialize Better Auth with the `electronServerPlugin`. This handles the ticket exchange and verification logic on your backend.\n\n#### The \"Silent Handoff\" Mechanism (Stateless & Secure)\n\nThis plugin implements a **Server-Side Cookie Interception** strategy to ensure strict isolation between the Web Session and the Electron Session.\n\n- It intercepts OAuth callback responses specifically for Electron. It actively **removes the `Set-Cookie` header** (which contains the session token) before the response reaches the browser.\n- This guarantees that the Electron login flow **does not overwrite or interfere** with the user's existing browser session.\n- Authentication relies solely on a one-time encrypted Ticket. The browser acts as a purely **`stateless`** transport layer for Electron.\n\n```typescript\nimport { betterAuth } from 'better-auth'\nimport { electronServerPlugin } from '@bigio/better-auth-electron/server'\n\nexport const auth = betterAuth({\n  baseURL: 'http://localhost:3002',\n  // ... your database configuration\n  plugins: [\n    electronServerPlugin({\n      // The custom scheme your Electron app uses (e.g. bigio://)\n      ELECTRON_SCHEME: 'bigio',\n      // Allowed providers for Electron OAuth flow\n      PROVIDERS: ['github', 'google'],\n    }),\n  ],\n  database: {\n    //...\n  },\n})\n```\n\n### 2. Electron Main Process (`src/main/index.ts`)\n\nUse `mainInjection` to setup IPC handlers and deep linking strategies. This automatically handles the \"protocol\" opening events.\n\n### Security & CSP Configuration\n\n** IMPORTANT: Clean up your `index.html`**\n\nThis plugin automatically injects a rigorous, production-ready **Content Security Policy (CSP)** via the Main Process.\n\n**You CAN remove** any manual CSP `<meta>` tags from your `index.html` (renderer). Leaving them in will cause the browser to enforce the \"intersection\" of both policies, likely breaking your Auth flow (e.g., blocking the OAuth popup or API connection).\n\n**DELETE this from your `index.html`:**\n\n```html\n<meta\n  http-equiv=\"Content-Security-Policy\"\n  content=\"\n  default-src 'self'; \n  script-src 'self'; \n  style-src 'self' 'unsafe-inline';\n  img-src 'self' data:;\n  connect-src 'self' http://localhost;\n  \" />\n```\n\n```typescript\nimport { app, BrowserWindow } from 'electron'\nimport { mainInjection } from '@bigio/better-auth-electron/main'\n\n// Initialize the plugin logic\nconst { windowInjection, whenReadyInjection } = mainInjection({\n  isOAuth: true,\n  ELECTRON_APP_NAME: 'bigio-electron-demo',\n  ELECTRON_SCHEME: 'bigio', // Must match the server config\n  PROVIDERS: ['github', 'google'],\n  BETTER_AUTH_BASEURL: 'http://localhost:3002',\n  FRONTEND_URL: 'http://localhost:3001/oauth',\n  /**\n   * [Optional] Content Security Policy (CSP) Configuration\n   * * Strategy: \"All-or-Nothing\"\n   * - undefined (Default): The plugin automatically injects a secure, production-ready CSP (The \"MVP\" Fallback).\n   * - string: The plugin uses YOUR string exactly. No merging, no magic. You take full control.\n   */\n  CONTENT_SECURITY_POLICY: \"default-src 'self'; ...\", // override completely\n})\n\nfunction createWindow(): void {\n  const mainWindow = new BrowserWindow({\n    /* config */\n  })\n\n  // Inject ipcRenderer event into the specific window instance\n  windowInjection(mainWindow)\n}\n\napp.whenReady().then(() => {\n  // Register custom protocol schemes\n  whenReadyInjection()\n  createWindow()\n})\n```\n\n**If CONTENT_SECURITY_POLICY is not provided, the plugin applies the following strictly secure rules to the Main Frame (index.html) automatically. This ensures Auth works out-of-the-box while keeping your app secure.**\n\n```http\ndefault-src 'self';\nscript-src 'self';\nstyle-src 'self' 'unsafe-inline';\n# Allows loading images from 'self', OAuth providers (https:), and your Auth Server\nimg-src 'self' data: blob: https: ${BETTER_AUTH_BASEURL};\n# Strictly restricts API connections to 'self' and your Auth Server\nconnect-src 'self' ${BETTER_AUTH_BASEURL};\nfont-src 'self' data:;\n# Prevents clickjacking attacks\nframe-ancestors 'none';\n```\n\n### 3. Web Client Initialization (`src/web/client.ts`)\n\nConfigure the client-side plugin. Note the usage of `setLazyClient` to handle circular dependencies or lazy initialization patterns effectively.\n\n```typescript\nimport { createAuthClient } from 'better-auth/react'\nimport { electronWebHandoffPlugin, setLazyClient } from '@bigio/better-auth-electron/web'\nimport type { auth } from '@/lib/auth' // Import type from your server file\n\nexport const authClient = createAuthClient({\n  baseURL: 'http://localhost:3002',\n  fetchOptions: {\n    credentials: 'include',\n  },\n  plugins: [\n    // Type-safe plugin initialization\n    electronWebHandoffPlugin<typeof auth>(),\n  ],\n})\n\n// Important: Register the client instance for plugin lazy access, this for soical signin\nsetLazyClient(authClient)\n```\n\n### 4. Electron Renderer/Web Client (`src/renderer/lib/auth-client.ts`)\n\nThis is the auth client running **inside your Electron app**. It listens for the custom protocol deep link to hydrate the session.\n\n> **Suggestion:** set `credentials: 'include'` to ensure the session cookie generated by the secure protocol is correctly persisted.\n\n```typescript\nimport { createAuthClient } from 'better-auth/react'\nimport { electronRendererPlugin } from '@bigio/better-auth-electron/renderer'\n\nexport const authClient = createAuthClient({\n  baseURL: 'http://localhost:3002',\n  fetchOptions: {\n    // It ensures cookies are sent/received correctly in the custom scheme.\n    credentials: 'include',\n  },\n  plugins: [\n    electronRendererPlugin({\n      ELECTRON_SCHEME: 'bigio', // Must match Main process config\n    }),\n  ],\n})\n```\n\n### 5. Electron Renderer Integration (New API)\n\nI have refactored the client-side integration to closely mirror the official Better Auth API structure, while adapting it for the specific constraints of the Electron environment (IPC & Deep Linking).\n\n### Key Features\n\n- **Official API Parity:** Uses a syntax similar to `authClient.signIn.social`.\n- **Callback Functions over URLs:** Instead of handling redirects, we use event subscriptions (`onDeepLinkSuccess`, `onDeepLinkNewUser`) to handle the authentication result.\n- **Cold Start Support:** The plugin includes an internal buffer. If the application is opened via a Deep Link before the UI is fully mounted, the plugin caches the session data and triggers the callback immediately upon registration.\n\n### Implementation\n\nIn your Electron renderer (e.g., `src/renderer/pages/login.tsx`), use the `bigio` namespace exposed by the client plugin.\n\n#### 1. Triggering the Sign-In\n\nUse `signInSocial` to initiate the flow. This handles the construction of the OAuth URL, serialization of scopes/parameters, and automatically opens the system default browser.\n\n**Note on Constraints:**\n\n1. **`disableRedirect`** is forced to `false`. The flow _must_ redirect to the deep link scheme to trigger the Electron app.\n2. **`additionalData`** is **JSON serialized and encoded into the URL**. Do not pass sensitive data or large objects, as they may hit browser URL length limits.\n\n```tsx\nimport { authClient } from '@/lib/auth-client' // Your initialized client\n\n// ... inside your component\n;<button\n  onClick={async () => {\n    await authClient.bigio.signInSocial({\n      // [Required] The provider key (e.g., 'github', 'google')\n      provider: 'github',\n\n      // [Optional] Array of OAuth scopes\n      scopes: ['repo', 'user'],\n\n      // [Optional] Object passed to the backend (JSON serialized via URL)\n      // Warning: Keep this payload small to avoid URL length issues.\n      additionalData: {\n        theme: 'dark',\n        ref_source: 'desktop_app',\n      },\n\n      // [Optional] Hint for the provider (e.g., email address)\n      loginHint: 'user@example.com',\n\n      // [Optional] Force a sign-up screen instead of sign-in\n      requestSignUp: false,\n    })\n  }}>\n  Sign in with GitHub\n</button>\n```\n\n#### 2. Handling the Callback (Deep Link)\n\nInstead of a page redirect, we listen for IPC completion events. You **must** register listeners for success, failure, and (optionally) new user creation.\n\nThese functions return an **unsubscribe** handler. You are responsible for cleaning this up to prevent memory leaks or double-firing events.\n\n```tsx\nimport { useEffect } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { authClient } from '@/lib/auth-client'\n\nexport default function LoginPage() {\n    const navigate = useNavigate()\n\n    useEffect(() => {\n        // 1. Handle Successful Login (Returning User)\n        const unsubscribeSuccess = authClient.bigio.onDeepLinkSuccess(async (data) => {\n            console.log('Login Successful:', data)\n            // data contains { user, session }\n            navigate('/dashboard')\n            return true\n        })\n\n        // 2. Handle New User Registration (First Time Login)\n        // If not provided, 'onDeepLinkSuccess' might be triggered depending on backend config,\n        // but it is recommended to handle new users explicitly if you have an onboarding flow.\n        const unsubscribeNewUser = authClient.bigio.onDeepLinkNewUser(async (data) => {\n             console.log('New User Registered:', data)\n             // data contains { user, session }\n             navigate('/onboarding')\n             return true\n        })\n\n        // 3. Handle Errors (Network issues, User denied access, Invalid State)\n        const unsubscribeError = authClient.bigio.onDeepLinkFailed(async (error) => {\n            console.error('Authentication Failed:', error)\n            // Show toast or error message\n        })\n\n        // Cleanup: Essential for React's StrictMode and component unmounting\n        return () => {\n            unsubscribeSuccess()\n            unsubscribeNewUser()\n            unsubscribeError()\n        }\n    }, [])\n\n    return (\n        // ... your JSX\n    )\n}\n\n```\n\n### API Reference: `signInSocial`\n\n| Parameter        | Type                      | Description                                                        |\n| ---------------- | ------------------------- | ------------------------------------------------------------------ |\n| `provider`       | `string`                  | **Required.** The key of the provider (e.g., `github`).            |\n| `scopes`         | `string[]`                | **Optional.** Additional OAuth scopes to request.                  |\n| `additionalData` | `Record<string, unknown>` | **Optional.** Metadata sent to the backend. **Serialized to URL.** |\n| `loginHint`      | `string`                  | **Optional.** Passes a hint (usually email) to the provider.       |\n| `requestSignUp`  | `boolean`                 | **Optional.** Hints the provider to show the registration page.    |\n\n### 6. Web/App Component Usage (`src/web/components/user-session.tsx`)\n\nThe `useElectronOAuthSession` hook is the core of the \"Handoff\" experience. It manages the synchronization between the web authentication state and the Electron application.\n\n#### Component Implementation\n\nThe hook provides reactive states to manage the UI. Most importantly, the 'pending' state serves as a \"Session Detected\" signal.\n\nTo resolve this state, you use the `setFastLogin` function. Calling this function immediately updates the oauthStatus and triggers the next step in the authentication flow.\n\n```tsx\nimport { useEffect } from 'react'\nimport { authClient } from '@/web/client'\n\nexport function UserSessionStatus() {\n  const {\n    data: sessionData,\n    error,\n    isPending, // Initial loading state\n\n    // Status enum: 'idle' | 'pending' | 'connecting' | 'succeed' | 'failed'\n    // 'pending': CRITICAL state. It confirms a valid session ALREADY exists\n    // and the system is pausing to wait for the user's decision.\n    oauthStatus,\n    oauthError,\n\n    // Action to control the flow:\n    // setFastLogin(true)  = Fast Login (Use current session)\n    // setFastLogin(false) = Switch Account (Ignore current session)\n    setFastLogin,\n  } = authClient.bigio.useElectronOAuthSession()\n\n  /**\n   * Optional: Force Logic (Auto-decision)\n   * If you want to skip the user choice UI:\n   */\n  useEffect(() => {\n    setFastLogin(true) // Force Fast Login immediately\n    // OR\n    setFastLogin(false) // Force Switch Account immediately\n  }, [])\n\n  /**\n   * Optional: User-decision\n   * If you want to let the user choice:\n   */\n  return (\n    <div>\n      {/* The 'pending' status indicates a session collision/detection.\n        We present the choice to the user here.\n      */}\n      {oauthStatus === 'pending' ? (\n        <>\n          {/* Option: Ignore current session and re-login */}\n          <button onClick={() => setFastLogin(false)}>Switch Account</button>\n          {/* Option: Use current session for Electron */}\n          <button onClick={() => setFastLogin(true)}>Fast Login</button>\n        </>\n      ) : null}\n    </div>\n  )\n}\n```\n\n## License\n\nMIT © [bigmusic](https://github.com/bigmusic/better-auth-electron)\n","readmeFilename":"README.md"}