{"_id":"@workos/authkit-astro","_rev":"9-d5d893126af31b086beb84a583291914","name":"@workos/authkit-astro","dist-tags":{"latest":"0.2.1"},"versions":{"0.0.1":{"name":"@workos/authkit-astro","version":"0.0.1","keywords":["workos","authkit","astro","astro-integration","withastro","authentication","auth"],"author":{"name":"WorkOS"},"license":"MIT","_id":"@workos/authkit-astro@0.0.1","maintainers":[{"name":"gjtorikian","email":"gjtorikian@gmail.com"},{"name":"npm-workos","email":"service+npm@workos.com"},{"name":"peakematt-workos","email":"matt.peake@workos.com"},{"name":"nickcollisson","email":"nick.collisson@workos.com"},{"name":"mark-workos","email":"mark@workos.com"},{"name":"grinich","email":"mgrinich@gmail.com"},{"name":"nicknisi","email":"nick@nisi.org"}],"homepage":"https://github.com/workos/authkit-astro#readme","bugs":{"url":"https://github.com/workos/authkit-astro/issues"},"dist":{"shasum":"985a9e8ada70ac9bf5af4068fe35cde44544c83b","tarball":"https://registry.npmjs.org/@workos/authkit-astro/-/authkit-astro-0.0.1.tgz","fileCount":49,"integrity":"sha512-QD/ZXsv+M24vJ2L/WsLtrzSWENPBV8d7PAktaluAK501zXMoqYAHuuLux/ocTPd2oSJwqORYQH9PGByEBZqA/A==","signatures":[{"sig":"MEQCIAsXpkS/4ksSw/vT9hb/2Jw8N0hx+e89WlcKF8axbHv8AiAK9vSJ73Z+VScVQaNBsa3oThIBHU+74QLnpcO5ZYrhIg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":145662},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./client":{"types":"./dist/client.d.ts","import":"./dist/client.js"},"./elements":{"types":"./dist/elements.d.ts","import":"./dist/elements.js"},"./components":{"types":"./components/index.d.ts","import":"./components/index.js"},"./package.json":"./package.json","./AuthState.astro":"./components/AuthState.astro","./internal/shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./internal/routes/me":"./dist/internal/routes/me.js","./internal/middleware":"./dist/internal/middleware.js","./internal/routes/login":"./dist/internal/routes/login.js","./internal/routes/logout":"./dist/internal/routes/logout.js","./internal/routes/signup":"./dist/internal/routes/signup.js","./internal/routes/callback":"./dist/internal/routes/callback.js"},"gitHead":"524d3231636cc1f7d914351cf68086f8c0b13cab","scripts":{"dev":"tsdown --watch","lint":"oxlint . --deny-warnings","test":"vitest run","build":"tsdown","format":"oxfmt .","lint:fix":"oxlint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"oxfmt --check .","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"gjtorikian","email":"gjtorikian@gmail.com"},"repository":{"url":"git+https://github.com/workos/authkit-astro.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.11.0","description":"Official WorkOS AuthKit SDK for Astro","directories":{},"sideEffects":["./dist/elements.js"],"_nodeVersion":"25.8.1","dependencies":{"nanostores":"^1.3.0","@workos/authkit-session":"^0.5.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^6.4.6","oxfmt":"^0.54.0","react":"^19.2.7","oxlint":"^1.69.0","tsdown":"^0.22.2","vitest":"^4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.17","@workos-inc/node":"^10.2.0","@vitest/coverage-v8":"^4.1.8"},"peerDependencies":{"astro":"^4.0.0 || ^5.0.0","react":"^18.0.0 || ^19.0.0","@workos-inc/node":"^8.0.0 || ^9.0.0 || ^10.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/authkit-astro_0.0.1_1781210132214_0.4989623995121757","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@workos/authkit-astro","version":"0.1.0","keywords":["workos","authkit","astro","astro-integration","withastro","authentication","auth"],"author":{"name":"WorkOS"},"license":"MIT","_id":"@workos/authkit-astro@0.1.0","maintainers":[{"name":"gjtorikian","email":"gjtorikian@gmail.com"},{"name":"npm-workos","email":"service+npm@workos.com"},{"name":"peakematt-workos","email":"matt.peake@workos.com"},{"name":"nickcollisson","email":"nick.collisson@workos.com"},{"name":"mark-workos","email":"mark@workos.com"},{"name":"grinich","email":"mgrinich@gmail.com"},{"name":"nicknisi","email":"nick@nisi.org"}],"homepage":"https://github.com/workos/authkit-astro#readme","bugs":{"url":"https://github.com/workos/authkit-astro/issues"},"dist":{"shasum":"bdb1e4b4bb0f906b188474cc74fc3d3807665dec","tarball":"https://registry.npmjs.org/@workos/authkit-astro/-/authkit-astro-0.1.0.tgz","fileCount":53,"integrity":"sha512-59VKCRRyXPGK2SUIhDCtAtRiOlJstQhoYnCze61VibiCXwiviku2Yc6xGbePWeDMz5gXDRYHpXz3PAA4Ir16Xg==","signatures":[{"sig":"MEQCIFZrXoz7oMhTrNBx6z1SV0NX4FTar8H7Yvw41RodTvLSAiApzWotOSvvZrfMMXyuiekErSENzVqbEU3+4H8Y5le3zA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@workos%2fauthkit-astro@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":156555},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./client":{"types":"./dist/client.d.ts","import":"./dist/client.js"},"./elements":{"types":"./dist/elements.d.ts","import":"./dist/elements.js"},"./components":{"types":"./components/index.d.ts","import":"./components/index.js"},"./package.json":"./package.json","./AuthState.astro":"./components/AuthState.astro","./internal/shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./internal/routes/me":"./dist/internal/routes/me.js","./internal/middleware":"./dist/internal/middleware.js","./internal/routes/login":"./dist/internal/routes/login.js","./internal/routes/logout":"./dist/internal/routes/logout.js","./internal/routes/signup":"./dist/internal/routes/signup.js","./internal/routes/callback":"./dist/internal/routes/callback.js"},"gitHead":"c73bc9d85930916a8a4f613aaabaf56cd7a552a8","scripts":{"dev":"tsdown --watch","lint":"oxlint . --deny-warnings","test":"vitest run","build":"tsdown","format":"oxfmt .","lint:fix":"oxlint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"oxfmt --check .","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7db45d3a-b666-4c40-a86c-5d538fc6bfe9"}},"repository":{"url":"git+https://github.com/workos/authkit-astro.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.13.0","description":"Official WorkOS AuthKit SDK for Astro","directories":{},"sideEffects":["./dist/elements.js"],"_nodeVersion":"24.17.0","dependencies":{"nanostores":"^1.3.0","path-to-regexp":"^6.3.0","@workos/authkit-session":"^0.5.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^6.4.6","oxfmt":"^0.54.0","react":"^19.2.7","oxlint":"^1.69.0","tsdown":"^0.22.2","vitest":"^4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.17","@workos-inc/node":"^10.2.0","@vitest/coverage-v8":"^4.1.8"},"peerDependencies":{"astro":"^4.0.0 || ^5.0.0 || ^6.0.0","react":"^18.0.0 || ^19.0.0","@workos-inc/node":"^8.0.0 || ^9.0.0 || ^10.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/authkit-astro_0.1.0_1782323309404_0.727436238272926","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@workos/authkit-astro","version":"0.1.1","keywords":["workos","authkit","astro","astro-integration","withastro","authentication","auth"],"author":{"name":"WorkOS"},"license":"MIT","_id":"@workos/authkit-astro@0.1.1","maintainers":[{"name":"gjtorikian","email":"gjtorikian@gmail.com"},{"name":"npm-workos","email":"service+npm@workos.com"},{"name":"peakematt-workos","email":"matt.peake@workos.com"},{"name":"nickcollisson","email":"nick.collisson@workos.com"},{"name":"mark-workos","email":"mark@workos.com"},{"name":"grinich","email":"mgrinich@gmail.com"},{"name":"nicknisi","email":"nick@nisi.org"}],"homepage":"https://github.com/workos/authkit-astro#readme","bugs":{"url":"https://github.com/workos/authkit-astro/issues"},"dist":{"shasum":"db4e1e3179c9ee40a726ad08c19eeb968b6e3047","tarball":"https://registry.npmjs.org/@workos/authkit-astro/-/authkit-astro-0.1.1.tgz","fileCount":53,"integrity":"sha512-HjRLiLxT4AecPemF6IFSKC0RZz2VHTuosBKI0gIbZatxJvcdeDIwIzuacRZ548+HjPdkkSKDoS/kDAA0hTt2Og==","signatures":[{"sig":"MEUCIQCftkq+/QnEzeXrQwcAOTh0wbAS0tBCh/3iZwfmsUu3swIgB3c8V9wc56TMk7FAMr/VxwqWHovMkc/Y9KN2nLRFne8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@workos%2fauthkit-astro@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":156525},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./client":{"types":"./dist/client.d.ts","import":"./dist/client.js"},"./elements":{"types":"./dist/elements.d.ts","import":"./dist/elements.js"},"./components":{"types":"./components/index.d.ts","import":"./components/index.js"},"./package.json":"./package.json","./AuthState.astro":"./components/AuthState.astro","./internal/shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./internal/routes/me":"./dist/internal/routes/me.js","./internal/middleware":"./dist/internal/middleware.js","./internal/routes/login":"./dist/internal/routes/login.js","./internal/routes/logout":"./dist/internal/routes/logout.js","./internal/routes/signup":"./dist/internal/routes/signup.js","./internal/routes/callback":"./dist/internal/routes/callback.js"},"gitHead":"4cbbc95aa0e622ba60e1e5044b9f206339f06fd4","scripts":{"dev":"tsdown --watch","lint":"oxlint . --deny-warnings","test":"vitest run","build":"tsdown","format":"oxfmt .","lint:fix":"oxlint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"oxfmt --check .","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7db45d3a-b666-4c40-a86c-5d538fc6bfe9"}},"repository":{"url":"git+https://github.com/workos/authkit-astro.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.13.0","description":"Official WorkOS AuthKit SDK for Astro","directories":{},"sideEffects":["./dist/elements.js"],"_nodeVersion":"24.16.0","dependencies":{"nanostores":"^1.3.0","path-to-regexp":"^6.3.0","@workos/authkit-session":"^0.5.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^7.0.2","oxfmt":"^0.54.0","react":"^19.2.7","oxlint":"^1.69.0","tsdown":"^0.22.2","vitest":"^4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.17","@workos-inc/node":"^10.2.0","@vitest/coverage-v8":"^4.1.8"},"peerDependencies":{"astro":"^6.0.0 || ^7.0.0","react":"^18.0.0 || ^19.0.0","@workos-inc/node":"^10.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/authkit-astro_0.1.1_1782324247687_0.5732576087046464","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@workos/authkit-astro","version":"0.2.0","keywords":["workos","authkit","astro","astro-integration","withastro","authentication","auth"],"author":{"name":"WorkOS"},"license":"MIT","_id":"@workos/authkit-astro@0.2.0","maintainers":[{"name":"gjtorikian","email":"gjtorikian@gmail.com"},{"name":"npm-workos","email":"service+npm@workos.com"},{"name":"peakematt-workos","email":"matt.peake@workos.com"},{"name":"nickcollisson","email":"nick.collisson@workos.com"},{"name":"mark-workos","email":"mark@workos.com"},{"name":"grinich","email":"mgrinich@gmail.com"},{"name":"nicknisi","email":"nick@nisi.org"}],"homepage":"https://github.com/workos/authkit-astro#readme","bugs":{"url":"https://github.com/workos/authkit-astro/issues"},"dist":{"shasum":"d6bbac1c59cbf3552988595617f6aca2d12258de","tarball":"https://registry.npmjs.org/@workos/authkit-astro/-/authkit-astro-0.2.0.tgz","fileCount":53,"integrity":"sha512-aagxYh7JHg1d/aSeU5IoOpWQ3X9eQyho+KXi03WqN5HbHOl8a+Y7E0s5MVsh7wbjvvqnCrm4QQ4yUctWtXknDg==","signatures":[{"sig":"MEUCIQDw0++vhxNZAyN3M/jRdQ8SIULF/ShrrxMpHrFQYIJg7gIgYPCqPznIe/pDB1BoTqyQi8TBocilHR8UuxuwEbkDlVs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@workos%2fauthkit-astro@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":158942},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./client":{"types":"./dist/client.d.ts","import":"./dist/client.js"},"./elements":{"types":"./dist/elements.d.ts","import":"./dist/elements.js"},"./components":{"types":"./components/index.d.ts","import":"./components/index.js"},"./package.json":"./package.json","./AuthState.astro":"./components/AuthState.astro","./internal/shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./internal/routes/me":"./dist/internal/routes/me.js","./internal/middleware":"./dist/internal/middleware.js","./internal/routes/login":"./dist/internal/routes/login.js","./internal/routes/logout":"./dist/internal/routes/logout.js","./internal/routes/signup":"./dist/internal/routes/signup.js","./internal/routes/callback":"./dist/internal/routes/callback.js"},"gitHead":"4192c7fd4adb46ef01daaea57f821bbfc8b8edaa","scripts":{"dev":"tsdown --watch","lint":"oxlint . --deny-warnings","test":"vitest run","build":"tsdown","format":"oxfmt .","lint:fix":"oxlint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"oxfmt --check .","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7db45d3a-b666-4c40-a86c-5d538fc6bfe9"}},"repository":{"url":"git+https://github.com/workos/authkit-astro.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.13.0","description":"Official WorkOS AuthKit SDK for Astro","directories":{},"sideEffects":["./dist/elements.js"],"_nodeVersion":"24.17.0","dependencies":{"nanostores":"^1.3.0","path-to-regexp":"^6.3.0","@workos/authkit-session":"^0.5.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^7.0.2","oxfmt":"^0.54.0","react":"^19.2.7","oxlint":"^1.69.0","tsdown":"^0.22.2","vitest":"^4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.17","@workos-inc/node":"^10.2.0","@vitest/coverage-v8":"^4.1.8"},"peerDependencies":{"astro":"^6.0.0 || ^7.0.0","react":"^18.0.0 || ^19.0.0","@workos-inc/node":"^10.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/authkit-astro_0.2.0_1782331717818_0.45920140382269437","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@workos/authkit-astro","version":"0.2.1","keywords":["workos","authkit","astro","astro-integration","withastro","authentication","auth"],"author":{"name":"WorkOS"},"license":"MIT","_id":"@workos/authkit-astro@0.2.1","maintainers":[{"name":"gjtorikian","email":"gjtorikian@gmail.com"},{"name":"npm-workos","email":"service+npm@workos.com"},{"name":"peakematt-workos","email":"matt.peake@workos.com"},{"name":"mark-workos","email":"mark@workos.com"},{"name":"grinich","email":"mgrinich@gmail.com"},{"name":"nicknisi","email":"nick@nisi.org"}],"homepage":"https://github.com/workos/authkit-astro#readme","bugs":{"url":"https://github.com/workos/authkit-astro/issues"},"dist":{"shasum":"eae01a43e805d131e08e9a913fbbb5c1cd65bf7e","tarball":"https://registry.npmjs.org/@workos/authkit-astro/-/authkit-astro-0.2.1.tgz","fileCount":53,"integrity":"sha512-m1PjSl0LO8WjRQumfjEYEHrd5F7Uh1XchraLdEsdCVCcAfTRVo0UV+u6IPajtqR3hDr37FJvAGk4CF9vbSoY4w==","signatures":[{"sig":"MEUCIBs6ia7b76952VTto3h+qTLGQQxf9cxAivuyXnL2tsPwAiEA17WUUOVKueltXjsPaWPeitUywBMc1FnbmP2eq9x+V74=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@workos%2fauthkit-astro@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":159500},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"},"./client":{"types":"./dist/client.d.ts","import":"./dist/client.js"},"./elements":{"types":"./dist/elements.d.ts","import":"./dist/elements.js"},"./components":{"types":"./components/index.d.ts","import":"./components/index.js"},"./package.json":"./package.json","./AuthState.astro":"./components/AuthState.astro","./internal/shared":{"types":"./dist/shared.d.ts","import":"./dist/shared.js"},"./internal/routes/me":"./dist/internal/routes/me.js","./internal/middleware":"./dist/internal/middleware.js","./internal/routes/login":"./dist/internal/routes/login.js","./internal/routes/logout":"./dist/internal/routes/logout.js","./internal/routes/signup":"./dist/internal/routes/signup.js","./internal/routes/callback":"./dist/internal/routes/callback.js"},"gitHead":"b504b20449e5cecf902c51ca43204b5a20347bbf","scripts":{"dev":"tsdown --watch","lint":"oxlint . --deny-warnings","test":"vitest run","build":"tsdown","format":"oxfmt .","lint:fix":"oxlint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"oxfmt --check .","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7db45d3a-b666-4c40-a86c-5d538fc6bfe9"}},"repository":{"url":"git+https://github.com/workos/authkit-astro.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.16.0","description":"Official WorkOS AuthKit SDK for Astro","directories":{},"sideEffects":["./dist/elements.js"],"_nodeVersion":"24.18.0","dependencies":{"nanostores":"^1.3.0","path-to-regexp":"^6.3.0","@workos/authkit-session":"^0.5.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^7.0.2","oxfmt":"^0.54.0","react":"^19.2.7","oxlint":"^1.69.0","tsdown":"^0.22.2","vitest":"^4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.17","@workos-inc/node":"^10.2.0","@vitest/coverage-v8":"^4.1.8"},"peerDependencies":{"astro":"^6.0.0 || ^7.0.0","react":"^18.0.0 || ^19.0.0","@workos-inc/node":"^10.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/authkit-astro_0.2.1_1785449861747_0.6804896158345612","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-11T20:35:31.971Z","modified":"2026-08-19T19:51:30.547Z","0.0.1":"2026-06-11T20:35:32.380Z","0.1.0":"2026-06-24T17:48:29.580Z","0.1.1":"2026-06-24T18:04:07.828Z","0.2.0":"2026-06-24T20:08:37.973Z","0.2.1":"2026-07-30T22:17:41.890Z"},"bugs":{"url":"https://github.com/workos/authkit-astro/issues"},"author":{"name":"WorkOS"},"license":"MIT","homepage":"https://github.com/workos/authkit-astro#readme","keywords":["workos","authkit","astro","astro-integration","withastro","authentication","auth"],"repository":{"url":"git+https://github.com/workos/authkit-astro.git","type":"git"},"description":"Official WorkOS AuthKit SDK for Astro","maintainers":[{"email":"gjtorikian@gmail.com","name":"gjtorikian"},{"email":"jacob.card-howe@workos.com","name":"jch-workos"},{"email":"matt@mattdavidson.kiwi","name":"mjdavidson"},{"email":"service+npm@workos.com","name":"npm-workos"},{"email":"matt.peake@workos.com","name":"peakematt-workos"},{"email":"jacobia@workos.com","name":"jacobia"},{"email":"mark@workos.com","name":"mark-workos"},{"email":"mgrinich@gmail.com","name":"grinich"},{"email":"nick@nisi.org","name":"nicknisi"}],"readme":"# @workos/authkit-astro\n\nOfficial [WorkOS AuthKit](https://workos.com/docs/user-management) SDK for\n[Astro](https://astro.build). Session validation, automatic token refresh,\nPKCE sign-in, route protection, auth components, and a client-island auth\nstore — built on\n[`@workos/authkit-session`](https://www.npmjs.com/package/@workos/authkit-session).\n\nRequires an SSR / on-demand Astro app (an adapter such as `@astrojs/node`).\nIndividual pages may still opt into prerendering — see\n[Prerendered pages](#prerendered-pages).\n\n## Quick start (integration)\n\n```bash\nnpx astro add node @workos/authkit-astro\n```\n\nAuthKit needs on-demand rendering, so install a server adapter (`node` here, or\nyour deployment target's adapter) alongside the integration — `astro add` wires\nup the adapter and `output`, then adds the integration to your config. Without\nan adapter the integration throws at startup, since its middleware and routes\nrun per request. Or do it by hand:\n\n```js\n// astro.config.mjs\nimport node from '@astrojs/node';\nimport authkit from '@workos/authkit-astro';\nimport { defineConfig } from 'astro/config';\n\nexport default defineConfig({\n  output: 'server',\n  adapter: node({ mode: 'standalone' }),\n  integrations: [authkit({ protectedRoutes: ['/dashboard'] })],\n});\n```\n\nThe integration auto-wires everything: the auth **middleware**, the\n**/login · /signup · /callback · /logout** routes, the client **session\nendpoint**, the **`astro:env` secret schema**, and the **`Astro.locals.auth`\ntypes**. You also need to install the WorkOS Node SDK peer (npx handles this\nfor you with `astro add`):\n\n```bash\nnpm add @workos-inc/node\n```\n\nThen provide the env vars (read at runtime via `astro:env`, never bundled):\n\n```bash\nWORKOS_CLIENT_ID=client_...\nWORKOS_API_KEY=sk_test_...\nWORKOS_REDIRECT_URI=http://localhost:4321/callback\nWORKOS_COOKIE_PASSWORD=at-least-32-characters-long-secret   # openssl rand -base64 32\n```\n\nAdd `http://localhost:4321/callback` as a redirect URI in the\n[WorkOS dashboard](https://dashboard.workos.com). That's it — `/dashboard` now\nredirects anonymous visitors to sign-in, and `Astro.locals.auth` is populated\n(and typed) everywhere.\n\n```astro\n---\nconst { auth } = Astro.locals;\n---\n{\n  auth.user ? (\n    <span>Signed in as {auth.user.email} · <a href=\"/logout\">Sign out</a></span>\n  ) : (\n    <a href=\"/login\">Sign in</a>\n  )\n}\n```\n\n### Integration options\n\n```ts\nauthkit({\n  protectedRoutes: ['/dashboard(.*)'], // prefixes or path-to-regexp 6.x patterns\n  signInPath: '/login', // where anonymous visitors are sent\n  loginPath: '/login', // patterns for the injected routes\n  signUpPath: '/signup',\n  callbackPath: '/callback',\n  logoutPath: '/logout',\n  afterSignOutUrl: '/', // where /logout lands (also accepts ?returnTo=)\n  errorRedirect: '/login', // redirect (with ?error=) on callback failure instead of a 400\n  sessionEndpoint: '/_authkit/me', // client store hydration endpoint\n  injectRoutes: true,\n  injectEnvSchema: true, // declare WORKOS_* in astro:env\n  hydrateClient: true, // session endpoint + client bootstrap script\n});\n```\n\n`protectedRoutes` accepts plain prefixes (`/dashboard` also matches\n`/dashboard/...`) and `path-to-regexp` 6.x patterns (`/dashboard(.*)`,\n`/orgs/:slug`, `/orgs/:slug?`,\n`/files/:path*`, `/users/:id(\\\\d+)`). Plain prefixes match nested paths;\npatterns match the full pathname. Anonymous browser navigations are redirected\nto `signInPath`; non-HTML requests (e.g. `fetch()` from an island) get a `401`\nJSON response instead.\n\n## `Astro.locals.auth`\n\nA discriminated union on `user` — checking `if (auth.user)` narrows\n`sessionId`, `accessToken`, and `claims` to non-optional types.\n\n```ts\nauth.user; // User | null\nauth.sessionId; // string  (signed in)\nauth.accessToken; // string  (signed in; server only — never sent to the client)\nauth.claims; // verified JWT claims, incl. custom claims (signed in)\nauth.organizationId; // string | null\nauth.role; // string | null\nauth.roles; // string[]\nauth.permissions; // string[]\nauth.entitlements; // string[]\nauth.featureFlags; // string[]\nauth.impersonator; // Impersonator | null\n\nauth.has({ role: 'admin' }); // boolean — also permission / entitlement / featureFlag; ANDs checks\nauth.redirectToSignIn(); // Response — redirect to sign-in, returnTo = current URL\n```\n\nGuard a page or endpoint imperatively:\n\n```astro\n---\nconst { auth } = Astro.locals;\nif (!auth.user) return auth.redirectToSignIn();\nif (!auth.has({ permission: 'billing:manage' })) return new Response(null, { status: 403 });\n---\n```\n\n## Components\n\nServer-rendered control and button components (the unmatched branch never\nreaches the browser on request-rendered pages):\n\n```astro\n---\nimport {\n  AuthState,    // synchronous client-store hydration (put in <head>)\n  Show,         // <Show when={{ role: 'admin' }}> ... <p slot=\"fallback\">…</p> </Show>\n  SignedIn,     // children render only when signed in\n  SignedOut,    // children render only when signed out\n  SignInButton, // <a> to the login route; props: path, returnTo, + anchor attrs\n  SignUpButton,\n  SignOutButton,\n  Impersonation, // fixed banner while the session is impersonated\n  UserButton, // account menu built from Astro.locals.auth.user\n  UserProfile, // server-rendered user summary\n  OrganizationSwitcher, // form for posting an active org switch\n  OrganizationProfile, // active organization summary\n} from '@workos/authkit-astro/components';\n---\n\n<SignedIn>\n  Welcome back! <UserButton profilePath=\"/account\" />\n</SignedIn>\n<SignedOut>\n  <SignInButton returnTo=\"/dashboard\">Log in</SignInButton>\n</SignedOut>\n\n<Show when={{ permission: 'invoices:create' }}>\n  <a href=\"/invoices/new\">New invoice</a>\n  <span slot=\"fallback\">Ask an admin for access.</span>\n</Show>\n```\n\n`when` accepts `'signed-in'`, `'signed-out'`, an object of\nrole/permission/entitlement/featureFlag checks (ANDed), or a predicate\n`(auth) => boolean` (server-rendered pages only). On prerendered pages the\ncomponents defer to the client store via a tiny `<authkit-gate>` custom\nelement instead. Add `serverOnly` to `<SignedIn>`, `<SignedOut>`, or `<Show>`\nwhen prerendered pages must not include gated children in their static HTML:\n\n```astro\n<SignedIn serverOnly>\n  <SecretAccountLink />\n</SignedIn>\n\n<Show when={{ permission: 'billing:manage' }} serverOnly>\n  <BillingAdminPanel />\n  <span slot=\"fallback\">Not available.</span>\n</Show>\n```\n\nThe user and organization components are intentionally data-driven. `UserButton`\nand `UserProfile` render from `Astro.locals.auth.user`. `OrganizationProfile`\nrenders the active organization id / role / permissions already present in the\nsession. `OrganizationSwitcher` needs the app to pass the organizations the\nuser can switch to, and posts the selected id to an endpoint you own:\n\n```astro\n<OrganizationSwitcher\n  action=\"/api/switch-org\"\n  organizations={[\n    { id: 'org_123', name: 'Acme' },\n    { id: 'org_456', name: 'Globex' },\n  ]}\n/>\n```\n\n## Client-island auth store\n\nRead the session reactively from any island (React, Vue, Svelte, Preact, Solid,\nor vanilla) via nanostores — the same store works across frameworks. The store\nholds a **client-safe** snapshot (no access token).\n\nHydrate it synchronously by dropping `<AuthState />` in your layout `<head>`:\n\n```astro\n---\n// src/layouts/Layout.astro\nimport { AuthState } from '@workos/authkit-astro/components';\n---\n<head>\n  <AuthState />\n</head>\n```\n\n(The integration also exposes `/_authkit/me`, so islands hydrate even without\n`<AuthState />` — just slightly later. With Astro's `<ClientRouter />` view\ntransitions, the store re-hydrates automatically after each navigation.)\n\nThen read it in an island:\n\n```tsx\n// React island\nimport { useStore } from '@nanostores/react';\nimport { $signedIn, $user } from '@workos/authkit-astro/client';\n\nexport function UserBadge() {\n  const user = useStore($user);\n  return <span>{user ? user.email : 'Signed out'}</span>;\n}\n```\n\nThe client entry exports the stores `$auth`, `$user`, `$signedIn`,\n`$isLoaded`, `$organizationId`, `$role`, `$permissions` and the helpers\n`setAuthState()` / `hydrateAuth()`. `$isLoaded` distinguishes \"not hydrated\nyet\" from \"signed out\" — gate loading UI on it. Use the matching\n`@nanostores/{react,vue,svelte,...}` binding for your island framework — or,\nfor React, the zero-dependency hooks:\n\n```tsx\nimport { useAuth, useUser } from '@workos/authkit-astro/react';\n\nexport function UserBadge() {\n  const { user, isLoaded } = useUser();\n  if (!isLoaded) return null;\n  return <span>{user ? user.email : 'Signed out'}</span>;\n}\n```\n\n## Manual setup (advanced)\n\nPrefer to wire things yourself (custom paths, full middleware control, no\nintegration)? The building blocks are exported directly.\n\n```ts\n// src/middleware.ts\nimport { authkitMiddleware, configureAuthKit, createRouteMatcher } from '@workos/authkit-astro';\nimport { WORKOS_API_KEY, WORKOS_CLIENT_ID, WORKOS_COOKIE_PASSWORD, WORKOS_REDIRECT_URI } from 'astro:env/server';\n\nconfigureAuthKit({\n  clientId: WORKOS_CLIENT_ID,\n  apiKey: WORKOS_API_KEY,\n  redirectUri: WORKOS_REDIRECT_URI,\n  cookiePassword: WORKOS_COOKIE_PASSWORD,\n});\n\n// Options form — string prefix, pattern, RegExp, or (pathname) => boolean:\nexport const onRequest = authkitMiddleware({\n  protectedRoutes: ['/dashboard(.*)', /^\\/admin/],\n});\n```\n\nOr take full per-request control with the handler form:\n\n```ts\nconst isAdminRoute = createRouteMatcher(['/admin(.*)', '/orgs/:slug/admin']);\n\nexport const onRequest = authkitMiddleware((auth, context) => {\n  if (isAdminRoute(context.url) && !auth.has({ role: 'admin' })) {\n    return auth.redirectToSignIn();\n  }\n});\n```\n\n```ts\n// src/pages/login.ts   (and signup.ts, logout.ts)\nexport { handleSignIn as GET } from '@workos/authkit-astro';\n```\n\n```ts\n// src/pages/callback.ts — drop-in, or customized:\nimport { createCallbackHandler } from '@workos/authkit-astro';\nexport const GET = createCallbackHandler({\n  errorRedirect: '/login',\n  onSuccess: (_ctx, { authResponse }) => console.log('signed in', authResponse.user.id),\n});\n```\n\n## Organizations\n\nSwitch the session's active organization (refreshes the access token scoped to\nthe org and persists the new session cookie):\n\n```ts\n// src/pages/api/switch-org.ts\nimport { switchToOrganization } from '@workos/authkit-astro';\n\nexport const POST: APIRoute = async (context) => {\n  const { organizationId } = await context.request.json();\n  const auth = await switchToOrganization(context, organizationId);\n  return Response.json({\n    organizationId: auth.organizationId,\n    role: auth.role,\n  });\n};\n```\n\nUse that endpoint with `<OrganizationSwitcher />`:\n\n```astro\n---\nimport { OrganizationSwitcher } from '@workos/authkit-astro/components';\n---\n\n<OrganizationSwitcher\n  action=\"/api/switch-org\"\n  organizations={[\n    { id: 'org_123', name: 'Acme' },\n    { id: 'org_456', name: 'Globex' },\n  ]}\n/>\n```\n\n## WorkOS API access\n\nThe full WorkOS Node client, sharing the SDK's configuration:\n\n```ts\nimport { getWorkOS } from '@workos/authkit-astro';\n\nconst org = await getWorkOS().organizations.getOrganization(auth.organizationId);\n```\n\n## Webhooks\n\nVerify the `workos-signature` header and get a parsed event back:\n\n```ts\n// src/pages/api/webhooks.ts\nimport { verifyWebhook } from '@workos/authkit-astro';\n\nexport const POST: APIRoute = async (context) => {\n  const event = await verifyWebhook(context); // secret from WORKOS_WEBHOOK_SECRET\n  if (event.event === 'user.created') {\n    // ...\n  }\n  return new Response(null, { status: 200 });\n};\n```\n\n## Prerendered pages\n\nPages with `export const prerender = true` build without a request, so the\nmiddleware skips session work there (`locals.auth` is signed-out and builds\ndon't need the `WORKOS_*` secrets). On those pages:\n\n- `<SignedIn>` / `<SignedOut>` / `<Show>` defer to the client store and\n  resolve after hydration (content is in the HTML — don't put secrets in it).\n- `<AuthState />` emits nothing; islands hydrate from the session endpoint.\n- Add `serverOnly` to `<SignedIn>`, `<SignedOut>`, or `<Show>` to render no\n  gated children during prerendering. For `<Show>`, the `fallback` slot is\n  rendered instead.\n\n## API\n\n| Export                                 | Type                | Purpose                                                               |\n| -------------------------------------- | ------------------- | --------------------------------------------------------------------- |\n| `default` (`workos`)                   | `AstroIntegration`  | The `astro add` integration                                           |\n| `authkitMiddleware(options?)`          | `MiddlewareHandler` | Validate session → `Astro.locals.auth`, refresh tokens, gate routes   |\n| `authkitMiddleware(handler, options?)` | `MiddlewareHandler` | Handler form: `(auth, context, next) =>` for full per-request control |\n| `createRouteMatcher(patterns)`         | `(input) => bool`   | Reusable matcher for prefixes / patterns / RegExps / predicates       |\n| `configureAuthKit(config)`             | `void`              | Provide config explicitly (e.g. from `astro:env`)                     |\n| `getWorkOS()`                          | `WorkOS`            | The configured WorkOS Node client                                     |\n| `switchToOrganization(ctx, orgId)`     | `Promise<auth>`     | Switch the session's active organization                              |\n| `getSignInUrl(ctx, opts?)`             | `Promise<string>`   | Sign-in URL + writes PKCE verifier cookie (for custom links)          |\n| `getSignUpUrl(ctx, opts?)`             | `Promise<string>`   | Sign-up URL variant                                                   |\n| `handleSignIn` / `handleSignUp`        | `APIRoute`          | Drop-in GET handlers that redirect to AuthKit                         |\n| `handleCallback`                       | `APIRoute`          | Drop-in GET handler for the OAuth callback                            |\n| `handleSignOut`                        | `APIRoute`          | Drop-in GET handler that clears the session and logs out              |\n| `createCallbackHandler(opts?)`         | `() => APIRoute`    | Callback with `errorRedirect` / `onSuccess` / `onError`               |\n| `createSignOutHandler(opts?)`          | `() => APIRoute`    | Sign-out with a custom `afterSignOutUrl`                              |\n| `verifyWebhook(ctx, opts?)`            | `Promise<Event>`    | Verify + parse a WorkOS webhook request                               |\n| `@workos/authkit-astro/components`     | Astro components    | `AuthState`, gates/buttons, impersonation, user/org components        |\n| `@workos/authkit-astro/client`         | nanostores          | `$auth`, `$user`, `$signedIn`, `$isLoaded`, …, `hydrateAuth`          |\n| `@workos/authkit-astro/react`          | hooks               | `useAuth()`, `useUser()` (no extra deps)                              |\n\n## How it works\n\n- The middleware calls `withAuth()` once per request, exposes the result on\n  `Astro.locals.auth`, and persists a refreshed token when one is issued.\n- Cookies (session + the short-lived PKCE verifier) are read and written\n  through Astro's native `context.cookies`, which Astro flushes onto the\n  response automatically — no manual `Set-Cookie` handling.\n- Sign-in is PKCE-bound: the login route writes a per-flow verifier cookie that\n  the callback verifies before exchanging the code.\n- `returnTo` values are restricted to relative paths everywhere, so the\n  login/logout flows can't be used as open redirects.\n- The client store is hydrated from a **client-safe** projection of the session\n  (`toClientAuth`) — the access token is never serialized to the browser.\n\n## Example\n\nA complete runnable app using the integration lives in [`example/`](./example).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}