

WorkOS has released a dedicated AuthKit SDK for Astro, enabling developers to add secure, server-first authentication with a single integration and minimal configuration.
Some core features include:
- An
astro addintegration that wires up the auth middleware, the sign-in/sign-up/callback/logout routes, and theastro:envsecrets - Middleware that validates and refreshes the session on every request, exposing a fully typed
Astro.locals.auth - Common server utilities, including
getSignInUrl,getSignUpUrl,switchToOrganization,getWorkOS, andverifyWebhook - Frequently used components, like <
SignedIn>, <SignedOut>, <Show> as well as an optional client-island store with zero-dependency React hooks.
Explore the implementation by visiting the GitHub repo. We've also provided an example application, which demonstrate protected routes, redirects, and authentication logic versatile enough for any Astro project.