Changelog

AuthKit for Astro

July 6, 2026
AuthKit for AstroAuthKit for Astro

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 add integration that wires up the auth middleware, the sign-in/sign-up/callback/logout routes, and the astro:env secrets
  • 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, and verifyWebhook
  • 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.