@mastra/auth-supabase 0.0.0-consolidate-changesets-20250904042643

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/LICENSE.md +15 -0
  3. package/README.md +80 -0
  4. package/dist/chunk-32EQK4OY.js +974 -0
  5. package/dist/chunk-32EQK4OY.js.map +1 -0
  6. package/dist/chunk-B2N25K77.cjs +979 -0
  7. package/dist/chunk-B2N25K77.cjs.map +1 -0
  8. package/dist/chunk-G7ML3FDV.js +9 -0
  9. package/dist/chunk-G7ML3FDV.js.map +1 -0
  10. package/dist/chunk-UYPX6MT6.cjs +32 -0
  11. package/dist/chunk-UYPX6MT6.cjs.map +1 -0
  12. package/dist/getMachineId-bsd-G4THBH3V.js +23 -0
  13. package/dist/getMachineId-bsd-G4THBH3V.js.map +1 -0
  14. package/dist/getMachineId-bsd-GQTQCD37.cjs +25 -0
  15. package/dist/getMachineId-bsd-GQTQCD37.cjs.map +1 -0
  16. package/dist/getMachineId-darwin-3P7FJFHV.js +24 -0
  17. package/dist/getMachineId-darwin-3P7FJFHV.js.map +1 -0
  18. package/dist/getMachineId-darwin-43NRSF2D.cjs +26 -0
  19. package/dist/getMachineId-darwin-43NRSF2D.cjs.map +1 -0
  20. package/dist/getMachineId-linux-H4F4I7A5.js +19 -0
  21. package/dist/getMachineId-linux-H4F4I7A5.js.map +1 -0
  22. package/dist/getMachineId-linux-TZ3NOAZ5.cjs +21 -0
  23. package/dist/getMachineId-linux-TZ3NOAZ5.cjs.map +1 -0
  24. package/dist/getMachineId-unsupported-EZLLFFYA.cjs +13 -0
  25. package/dist/getMachineId-unsupported-EZLLFFYA.cjs.map +1 -0
  26. package/dist/getMachineId-unsupported-T3AERO5R.js +11 -0
  27. package/dist/getMachineId-unsupported-T3AERO5R.js.map +1 -0
  28. package/dist/getMachineId-win-B5AEGZT7.cjs +47 -0
  29. package/dist/getMachineId-win-B5AEGZT7.cjs.map +1 -0
  30. package/dist/getMachineId-win-Z5QAASBF.js +25 -0
  31. package/dist/getMachineId-win-Z5QAASBF.js.map +1 -0
  32. package/dist/index.cjs +460 -0
  33. package/dist/index.cjs.map +1 -0
  34. package/dist/index.d.ts +15 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +458 -0
  37. package/dist/index.js.map +1 -0
  38. package/package.json +54 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,59 @@
1
+ # @mastra/auth-supabase
2
+
3
+ ## 0.0.0-consolidate-changesets-20250904042643
4
+
5
+ ### Patch Changes
6
+
7
+ - de3cbc6: Update the `package.json` file to include additional fields like `repository`, `homepage` or `files`.
8
+
9
+ ## 0.10.5-alpha.0
10
+
11
+ ### Patch Changes
12
+
13
+ - [#7343](https://github.com/mastra-ai/mastra/pull/7343) [`de3cbc6`](https://github.com/mastra-ai/mastra/commit/de3cbc61079211431bd30487982ea3653517278e) Thanks [@LekoArts](https://github.com/LekoArts)! - Update the `package.json` file to include additional fields like `repository`, `homepage` or `files`.
14
+
15
+ ## 0.10.4
16
+
17
+ ### Patch Changes
18
+
19
+ - [`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix peerdpes for @mastra/core
20
+
21
+ ## 0.10.3
22
+
23
+ ### Patch Changes
24
+
25
+ - 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
26
+
27
+ ## 0.10.3-alpha.0
28
+
29
+ ### Patch Changes
30
+
31
+ - 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
32
+
33
+ ## 0.10.2
34
+
35
+ ### Patch Changes
36
+
37
+ - 2d7098e: dependencies updates:
38
+ - Updated dependency [`@supabase/supabase-js@^2.50.3` ↗︎](https://www.npmjs.com/package/@supabase/supabase-js/v/2.50.3) (from `^2.50.0`, in `dependencies`)
39
+
40
+ ## 0.10.2-alpha.0
41
+
42
+ ### Patch Changes
43
+
44
+ - 2d7098e: dependencies updates:
45
+ - Updated dependency [`@supabase/supabase-js@^2.50.3` ↗︎](https://www.npmjs.com/package/@supabase/supabase-js/v/2.50.3) (from `^2.50.0`, in `dependencies`)
46
+
47
+ ## 0.10.1
48
+
49
+ ### Patch Changes
50
+
51
+ - 63f6b7d: dependencies updates:
52
+ - Updated dependency [`@supabase/supabase-js@^2.50.0` ↗︎](https://www.npmjs.com/package/@supabase/supabase-js/v/2.50.0) (from `^2.49.7`, in `dependencies`)
53
+
54
+ ## 0.10.1-alpha.0
55
+
56
+ ### Patch Changes
57
+
58
+ - 63f6b7d: dependencies updates:
59
+ - Updated dependency [`@supabase/supabase-js@^2.50.0` ↗︎](https://www.npmjs.com/package/@supabase/supabase-js/v/2.50.0) (from `^2.49.7`, in `dependencies`)
package/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ # Apache License 2.0
2
+
3
+ Copyright (c) 2025 Kepler Software, Inc.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @mastra/auth-supabase
2
+
3
+ A Supabase authentication integration for Mastra, providing seamless authentication and authorization capabilities using Supabase's authentication system.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/auth-supabase
9
+ # or
10
+ yarn add @mastra/auth-supabase
11
+ # or
12
+ pnpm add @mastra/auth-supabase
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ import { Mastra } from '@mastra/core';
19
+ import { MastraAuthSupabase } from '@mastra/auth-supabase';
20
+
21
+ // Initialize with environment variables
22
+ const auth = new MastraAuthSupabase();
23
+
24
+ // Or initialize with explicit configuration
25
+ const auth = new MastraAuthSupabase({
26
+ url: 'your-supabase-url',
27
+ anonKey: 'your-supabase-anon-key',
28
+ });
29
+
30
+ // Enable auth in Mastra
31
+ const mastra = new Mastra({
32
+ ...
33
+ server: {
34
+ experimental_auth: auth,
35
+ },
36
+ });
37
+ ```
38
+
39
+ ## Configuration
40
+
41
+ The package can be configured in two ways:
42
+
43
+ 1. **Environment Variables**:
44
+ - `SUPABASE_URL`: Your Supabase project URL
45
+ - `SUPABASE_ANON_KEY`: Your Supabase anonymous key
46
+
47
+ 2. **Constructor Options**:
48
+ ```typescript
49
+ interface MastraAuthSupabaseOptions {
50
+ url?: string;
51
+ anonKey?: string;
52
+ }
53
+ ```
54
+
55
+ ## Features
56
+
57
+ - **Authentication**: Verifies user tokens and retrieves user information from Supabase
58
+ - **Authorization**: Checks user permissions based on their role in Supabase
59
+ - **Type Safety**: Full TypeScript support with proper type definitions
60
+ - **Environment Variable Support**: Easy configuration through environment variables
61
+
62
+ ## API
63
+
64
+ ### `authenticateToken(token: string)`
65
+
66
+ Authenticates a user token and returns the user information if valid.
67
+
68
+ ### `authorizeUser(user: User)`
69
+
70
+ Checks if a user has the required permissions (currently checks for admin status).
71
+
72
+ ## Requirements
73
+
74
+ - Node.js 16 or higher
75
+ - Supabase project with authentication enabled
76
+ - Supabase URL and anonymous key
77
+
78
+ ## License
79
+
80
+ Elastic-2.0