@mastra/auth
v1.1.4
Published
Downloads
121,669
Keywords
Readme
@mastra/auth
Authentication utilities for protecting Mastra server endpoints and carrying trusted user context through agents and tools. The package exports MastraJwtAuth for JWT-based authentication; provider-specific integrations are published as separate @mastra/auth-* packages.
Installation
npm install @mastra/authUsage
Set JWT_AUTH_SECRET or pass a secret explicitly.
import { MastraJwtAuth } from '@mastra/auth';
import { Mastra } from '@mastra/core/mastra';
const auth = new MastraJwtAuth({ secret: process.env.JWT_AUTH_SECRET });
export const mastra = new Mastra({
server: { auth },
});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.
