MastraM
Mastra3mo ago
Zack

Using `MastraAuthClerk` breaks mastra cloud deployment

When you use MastraAuthClerk (https://mastra.ai/en/docs/auth/clerk) it breaks any deployment on mastra cloud because the health check fails.

server: {
        timeout: 60000,
        experimental_auth:
            process.env.NODE_ENV !== "development"
                ? new MastraAuthClerk({
                      publishableKey: process.env.CLERK_SECRET_KEY,
                      secretKey: process.env.CLERK_SECRET_KEY,
                      jwksUri: process.env.CLERK_JWKS_URI,
                  })
                : undefined,
    },
Screenshot_2025-10-16_at_7.16.56_PM.png
Documentation for the MastraAuthClerk class, which authenticates Mastra applications using Clerk authentication.
Was this page helpful?