mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
|
History
|
||
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| lint-staged.config.js | ||
| oxlint.config.ts | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsdown.config.ts | ||
| turbo.json | ||
| vitest.config.ts | ||
@mastra/auth-auth0
@mastra/auth-auth0 verifies Auth0 access tokens and makes the authenticated user available to Mastra's server authorization layer. Use it when Auth0 already issues JWTs for your application and you want Mastra endpoints protected by the same identity provider.
Installation
npm install @mastra/auth-auth0
Usage
Set AUTH0_DOMAIN and AUTH0_AUDIENCE, or pass both values to the provider.
import { MastraAuthAuth0 } from '@mastra/auth-auth0';
import { Mastra } from '@mastra/core/mastra';
export const mastra = new Mastra({
server: {
auth: new MastraAuthAuth0({
domain: process.env.AUTH0_DOMAIN,
audience: process.env.AUTH0_AUDIENCE,
}),
},
});
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.