# MastraJwtAuth Class
[EN] Source: https://mastra.ai/reference/auth/jwt

The `MastraJwtAuth` class provides a lightweight authentication mechanism for Mastra using JSON Web Tokens (JWTs). It verifies incoming requests based on a shared secret and integrates with the Mastra server using the `experimental_auth` option.

## Usage example

```typescript title="src/mastra/index.ts" showLineNumbers copy
import { Mastra } from "@mastra/core/mastra";
import { MastraJwtAuth } from "@mastra/auth";

export const mastra = new Mastra({
  // ..
  server: {
    experimental_auth: new MastraJwtAuth({
      secret: "<your-secret>",
    }),
  },
});
```

## Constructor parameters

<PropertiesTable
  content={[
    {
      name: "secret",
      type: "string",
      description:
        "A unique string used to sign and verify JSON Web Tokens (JWTs) for authenticating incoming requests.",
      isOptional: false,
    },
  ]}
/>

## Related

[MastraJwtAuth](/docs/auth/jwt)


---
title: "Reference: MastraAuthSupabase Class | Auth"
description: "API reference for the MastraAuthSupabase class, which authenticates Mastra applications using Supabase Auth."
---