---
title: "AuthKit for Astro"
description: "Easily add AuthKit authentication to any Astro site"
url: https://workos.com/changelog/authkit-for-astro
---

# AuthKit for Astro

WorkOS has released a dedicated [AuthKit SDK for Astro](https://github.com/workos/authkit-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.
