@mastra/auth-supabase 1.1.4-alpha.0 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -51
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,76 +1,40 @@
|
|
|
1
1
|
# @mastra/auth-supabase
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Requirements
|
|
6
|
-
|
|
7
|
-
- Node.js 22.13.0 or later
|
|
8
|
-
- Supabase project with authentication enabled
|
|
9
|
-
- Supabase URL and anonymous key
|
|
3
|
+
`@mastra/auth-supabase` verifies Supabase access tokens and exposes Supabase users to Mastra's authorization layer. Use it when Supabase Auth already manages your application users and you want the same sessions to protect Mastra endpoints.
|
|
10
4
|
|
|
11
5
|
## Installation
|
|
12
6
|
|
|
13
7
|
```bash
|
|
14
8
|
npm install @mastra/auth-supabase
|
|
15
|
-
# or
|
|
16
|
-
yarn add @mastra/auth-supabase
|
|
17
|
-
# or
|
|
18
|
-
pnpm add @mastra/auth-supabase
|
|
19
9
|
```
|
|
20
10
|
|
|
21
11
|
## Usage
|
|
22
12
|
|
|
13
|
+
Set `SUPABASE_URL` and `SUPABASE_ANON_KEY` before starting Mastra.
|
|
14
|
+
|
|
23
15
|
```typescript
|
|
24
16
|
import { Mastra } from '@mastra/core/mastra';
|
|
25
17
|
import { MastraAuthSupabase } from '@mastra/auth-supabase';
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
const supabaseAuth = new MastraAuthSupabase();
|
|
29
|
-
|
|
30
|
-
// Or initialize with explicit configuration
|
|
31
|
-
const supabaseAuth = new MastraAuthSupabase({
|
|
32
|
-
url: 'your-supabase-url',
|
|
33
|
-
anonKey: 'your-supabase-anon-key',
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// Enable auth in Mastra
|
|
37
|
-
const mastra = new Mastra({
|
|
38
|
-
...
|
|
19
|
+
export const mastra = new Mastra({
|
|
39
20
|
server: {
|
|
40
|
-
auth:
|
|
21
|
+
auth: new MastraAuthSupabase({
|
|
22
|
+
url: process.env.SUPABASE_URL,
|
|
23
|
+
anonKey: process.env.SUPABASE_ANON_KEY,
|
|
24
|
+
}),
|
|
41
25
|
},
|
|
42
26
|
});
|
|
43
27
|
```
|
|
44
28
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
The package can be configured in two ways:
|
|
48
|
-
|
|
49
|
-
1. **Environment Variables**:
|
|
50
|
-
- `SUPABASE_URL`: Your Supabase project URL
|
|
51
|
-
- `SUPABASE_ANON_KEY`: Your Supabase anonymous key
|
|
52
|
-
|
|
53
|
-
2. **Constructor Options**:
|
|
54
|
-
```typescript
|
|
55
|
-
interface MastraAuthSupabaseOptions {
|
|
56
|
-
url?: string;
|
|
57
|
-
anonKey?: string;
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Features
|
|
62
|
-
|
|
63
|
-
- **Authentication**: Verifies user tokens and retrieves user information from Supabase
|
|
64
|
-
- **Authorization**: Checks user permissions based on their role in Supabase
|
|
65
|
-
- **Type Safety**: Full TypeScript support with proper type definitions
|
|
66
|
-
- **Environment Variable Support**: Easy configuration through environment variables
|
|
29
|
+
## Documentation
|
|
67
30
|
|
|
68
|
-
|
|
31
|
+
- [Supabase integration guide](https://mastra.ai/integrations/auth/supabase)
|
|
32
|
+
- [Supabase provider reference](https://mastra.ai/reference/auth/supabase)
|
|
69
33
|
|
|
70
|
-
|
|
34
|
+
## Changelog
|
|
71
35
|
|
|
72
|
-
|
|
36
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/auth/supabase/CHANGELOG.md) for version history and release notes.
|
|
73
37
|
|
|
74
|
-
|
|
38
|
+
## Support
|
|
75
39
|
|
|
76
|
-
|
|
40
|
+
We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/auth-supabase",
|
|
3
|
-
"version": "1.1.4
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Mastra Supabase Auth integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"tsdown": "0.22.9",
|
|
31
31
|
"typescript": "^7.0.2",
|
|
32
32
|
"vitest": "4.1.10",
|
|
33
|
-
"@internal/auth": "0.0.
|
|
34
|
-
"@internal/lint": "0.0.
|
|
35
|
-
"@internal/types-builder": "0.0.
|
|
33
|
+
"@internal/auth": "0.0.20",
|
|
34
|
+
"@internal/lint": "0.0.130",
|
|
35
|
+
"@internal/types-builder": "0.0.105"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist"
|