@mastra/auth-clerk 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.
- package/CHANGELOG.md +59 -0
- package/LICENSE.md +15 -0
- package/README.md +79 -0
- package/dist/chunk-32EQK4OY.js +974 -0
- package/dist/chunk-32EQK4OY.js.map +1 -0
- package/dist/chunk-B2N25K77.cjs +979 -0
- package/dist/chunk-B2N25K77.cjs.map +1 -0
- package/dist/chunk-G7ML3FDV.js +9 -0
- package/dist/chunk-G7ML3FDV.js.map +1 -0
- package/dist/chunk-UYPX6MT6.cjs +32 -0
- package/dist/chunk-UYPX6MT6.cjs.map +1 -0
- package/dist/getMachineId-bsd-G4THBH3V.js +23 -0
- package/dist/getMachineId-bsd-G4THBH3V.js.map +1 -0
- package/dist/getMachineId-bsd-GQTQCD37.cjs +25 -0
- package/dist/getMachineId-bsd-GQTQCD37.cjs.map +1 -0
- package/dist/getMachineId-darwin-3P7FJFHV.js +24 -0
- package/dist/getMachineId-darwin-3P7FJFHV.js.map +1 -0
- package/dist/getMachineId-darwin-43NRSF2D.cjs +26 -0
- package/dist/getMachineId-darwin-43NRSF2D.cjs.map +1 -0
- package/dist/getMachineId-linux-H4F4I7A5.js +19 -0
- package/dist/getMachineId-linux-H4F4I7A5.js.map +1 -0
- package/dist/getMachineId-linux-TZ3NOAZ5.cjs +21 -0
- package/dist/getMachineId-linux-TZ3NOAZ5.cjs.map +1 -0
- package/dist/getMachineId-unsupported-EZLLFFYA.cjs +13 -0
- package/dist/getMachineId-unsupported-EZLLFFYA.cjs.map +1 -0
- package/dist/getMachineId-unsupported-T3AERO5R.js +11 -0
- package/dist/getMachineId-unsupported-T3AERO5R.js.map +1 -0
- package/dist/getMachineId-win-B5AEGZT7.cjs +47 -0
- package/dist/getMachineId-win-B5AEGZT7.cjs.map +1 -0
- package/dist/getMachineId-win-Z5QAASBF.js +25 -0
- package/dist/getMachineId-win-Z5QAASBF.js.map +1 -0
- package/dist/index.cjs +467 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +465 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @mastra/auth-clerk
|
|
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
|
+
- Updated dependencies [de3cbc6]
|
|
9
|
+
- @mastra/auth@0.0.0-consolidate-changesets-20250904042643
|
|
10
|
+
|
|
11
|
+
## 0.10.4-alpha.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#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`.
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`de3cbc6`](https://github.com/mastra-ai/mastra/commit/de3cbc61079211431bd30487982ea3653517278e)]:
|
|
18
|
+
- @mastra/auth@0.1.3-alpha.0
|
|
19
|
+
|
|
20
|
+
## 0.10.3
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix peerdpes for @mastra/core
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [[`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430)]:
|
|
27
|
+
- @mastra/auth@0.1.2
|
|
28
|
+
|
|
29
|
+
## 0.10.2
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
34
|
+
- Updated dependencies [4a406ec]
|
|
35
|
+
- @mastra/auth@0.1.1
|
|
36
|
+
|
|
37
|
+
## 0.10.2-alpha.0
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
42
|
+
- Updated dependencies [4a406ec]
|
|
43
|
+
- @mastra/auth@0.1.1-alpha.0
|
|
44
|
+
|
|
45
|
+
## 0.10.1
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- 63f6b7d: dependencies updates:
|
|
50
|
+
- Updated dependency [`@clerk/backend@^1.34.0` ↗︎](https://www.npmjs.com/package/@clerk/backend/v/1.34.0) (from `^1.32.3`, in `dependencies`)
|
|
51
|
+
- @mastra/auth@0.1.0
|
|
52
|
+
|
|
53
|
+
## 0.10.1-alpha.0
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- 63f6b7d: dependencies updates:
|
|
58
|
+
- Updated dependency [`@clerk/backend@^1.34.0` ↗︎](https://www.npmjs.com/package/@clerk/backend/v/1.34.0) (from `^1.32.3`, in `dependencies`)
|
|
59
|
+
- @mastra/auth@0.1.0
|
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,79 @@
|
|
|
1
|
+
# @mastra/auth-clerk
|
|
2
|
+
|
|
3
|
+
A Mastra authentication provider for Clerk, enabling seamless integration of Clerk authentication with Mastra applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mastra/auth-clerk
|
|
9
|
+
# or
|
|
10
|
+
yarn add @mastra/auth-clerk
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @mastra/auth-clerk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { Mastra } from '@mastra/core';
|
|
19
|
+
import { MastraAuthClerk } from '@mastra/auth-clerk';
|
|
20
|
+
|
|
21
|
+
// Initialize the Clerk auth provider
|
|
22
|
+
const clerkAuth = new MastraAuthClerk({
|
|
23
|
+
jwksUri: 'your-jwks-uri',
|
|
24
|
+
secretKey: 'your-secret-key',
|
|
25
|
+
publishableKey: 'your-publishable-key',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Or use environment variables
|
|
29
|
+
const clerkAuth = new MastraAuthClerk();
|
|
30
|
+
|
|
31
|
+
// Enable auth in Mastra
|
|
32
|
+
const mastra = new Mastra({
|
|
33
|
+
...
|
|
34
|
+
server: {
|
|
35
|
+
experimental_auth: clerkAuth,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
The package can be configured either through constructor options or environment variables:
|
|
43
|
+
|
|
44
|
+
### Environment Variables
|
|
45
|
+
|
|
46
|
+
- `CLERK_JWKS_URI`: The JWKS URI for your Clerk instance
|
|
47
|
+
- `CLERK_SECRET_KEY`: Your Clerk secret key
|
|
48
|
+
- `CLERK_PUBLISHABLE_KEY`: Your Clerk publishable key
|
|
49
|
+
|
|
50
|
+
### Constructor Options
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
interface MastraAuthClerkOptions {
|
|
54
|
+
jwksUri?: string;
|
|
55
|
+
secretKey?: string;
|
|
56
|
+
publishableKey?: string;
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
- JWT token verification using Clerk's JWKS
|
|
63
|
+
- User authentication and authorization
|
|
64
|
+
- Organization membership verification
|
|
65
|
+
- Seamless integration with Mastra's authentication system
|
|
66
|
+
|
|
67
|
+
## API
|
|
68
|
+
|
|
69
|
+
### `authenticateToken(token: string): Promise<ClerkUser | null>`
|
|
70
|
+
|
|
71
|
+
Verifies a JWT token and returns the associated user if valid.
|
|
72
|
+
|
|
73
|
+
### `authorizeUser(user: ClerkUser): Promise<boolean>`
|
|
74
|
+
|
|
75
|
+
Checks if a user is authorized by verifying their organization membership.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|