āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/clerk/clerk-docs/guides/development/deployment/astro ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
[!WARNING] This guide assumes that you have already installed Clerk in your application locally and are ready to deploy. If you haven't installed Clerk yet, see the quickstart guide.
This guide will walk you through the steps to deploy your Astro app to production.
Follow the guide on deploying your Clerk app to production.
To deploy to a hosting platform, it's recommended to choose one of the official adapters Astro offers. While the Node.js and Cloudflare adapters work out-of-the-box with Clerk, the Netlify and Vercel adapters have caveats. See the following sections for more information.
Due to Netlify's caching strategies, one of Clerk's core mechanisms is unable to work as expected, resulting in infinite redirects that cause an app to fail. This also affects preview environments that use development API keys. It's recommended to use production API keys with a new domain.
Additionally, read this section about Edge middleware.
Read this section about Edge middleware.
The Netlify and Vercel adapters allow developers to convert the Astro middleware to an Edge middleware.
Currently, this is expected to not work for the following reasons:
Astro.locals.auth with a function that cannot be serialized.clerkMiddleware uses Async Local Storage, and it's stored value will not persist across the runtimes.ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā