Docs

Clerk Astro SDK

The Clerk Astro SDK is the recommended method for integrating Clerk into your Astro application.

Guides

Client-side helpers

The Astro SDK provides stores that give you access to the Clerk object and helper methods for authentication flows.

Server-side helpers

The following references show how to integrate Clerk features into your Astro app on the server-side.

Locals

The Astro SDK provides access to Clerk's authentication data through Astro's locals object. The following references show how to access authentication data in server-side code:

Auth object

Astro.locals.auth() returns an Auth object. This JavaScript object contains important information like session data, your user's ID, as well as their active organization ID. Learn more about the Auth object here.

clerkMiddleware()

The clerkMiddleware() helper integrates Clerk authentication and authorization into your Astro application through middleware. You can learn more here.

Feedback

What did you think of this content?

Last updated on