@mastra/auth-clerk
v1.3.2
Published
Mastra Clerk Auth integration
Keywords
Readme
@mastra/auth-clerk
@mastra/auth-clerk verifies Clerk session tokens and exposes the authenticated user to Mastra's server authorization layer. Use it when your application already uses Clerk and Mastra should protect its API routes with the same users and sessions.
Installation
npm install @mastra/auth-clerkUsage
Set CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, and CLERK_JWKS_URI before starting Mastra.
import { MastraAuthClerk } from '@mastra/auth-clerk';
import { Mastra } from '@mastra/core/mastra';
export const mastra = new Mastra({
server: {
auth: new MastraAuthClerk({
publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
secretKey: process.env.CLERK_SECRET_KEY,
jwksUri: process.env.CLERK_JWKS_URI,
}),
},
});Documentation
Changelog
See the package changelog for version history and release notes.
Support
We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.
