@mastra/auth-better-auth 1.1.4 → 1.1.5-alpha.0

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 DELETED
@@ -1,318 +0,0 @@
1
- # @mastra/auth-better-auth
2
-
3
- ## 1.1.4
4
-
5
- ### Patch Changes
6
-
7
- - Resolve a default `activeOrganizationId` from the user's oldest existing membership when the stored better-auth session has no `activeOrganizationId` set. Nothing in a default sign-in flow calls the organization plugin's `setActive`, so the field was always null and org-scoped consumers saw users with no organization. ([#21482](https://github.com/mastra-ai/mastra/pull/21482))
8
-
9
- ```ts
10
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
11
-
12
- const mastraAuth = new MastraAuthBetterAuth({ auth });
13
- const user = await mastraAuth.authenticateToken(token, request);
14
- // Populated even when the sign-in flow never called `setActive`.
15
- console.log(user?.session.activeOrganizationId);
16
- ```
17
-
18
- The resolution is read-only and best-effort: the session row is not mutated, users with no memberships still authenticate, and a failed lookup falls back to today's behavior. Caveats: the resolved value is an inferred default, not an explicit user selection, and a session whose active organization was deliberately cleared via `setActive` is indistinguishable from one that was never set, so it also receives the default. A membership removed by an administrator stops being applied to new sessions within about a minute.
19
-
20
- - Fixed reading request headers from Express-style plain header objects so cookie-based auth providers no longer throw and fail with a misleading 401. ([#21261](https://github.com/mastra-ai/mastra/pull/21261))
21
-
22
- Related to https://github.com/mastra-ai/mastra/issues/21253
23
-
24
- ## 1.1.4-alpha.1
25
-
26
- ### Patch Changes
27
-
28
- - Resolve a default `activeOrganizationId` from the user's oldest existing membership when the stored better-auth session has no `activeOrganizationId` set. Nothing in a default sign-in flow calls the organization plugin's `setActive`, so the field was always null and org-scoped consumers saw users with no organization. ([#21482](https://github.com/mastra-ai/mastra/pull/21482))
29
-
30
- The resolution is read-only and best-effort: the session row is not mutated, users with no memberships still authenticate, and a failed lookup falls back to today's behavior. Caveats: the resolved value is an inferred default, not an explicit user selection, and a session whose active organization was deliberately cleared via `setActive` is indistinguishable from one that was never set, so it also receives the default. A membership removed by an administrator stops being applied to new sessions within about a minute.
31
-
32
- ## 1.1.4-alpha.0
33
-
34
- ### Patch Changes
35
-
36
- - Fixed reading request headers from Express-style plain header objects so cookie-based auth providers no longer throw and fail with a misleading 401. ([#21261](https://github.com/mastra-ai/mastra/pull/21261))
37
-
38
- Related to https://github.com/mastra-ai/mastra/issues/21253
39
-
40
- ## 1.1.3
41
-
42
- ### Patch Changes
43
-
44
- - dependencies updates: ([#20162](https://github.com/mastra-ai/mastra/pull/20162))
45
- - Updated dependency [`better-auth@^1.6.23` ↗︎](https://www.npmjs.com/package/better-auth/v/1.6.23) (from `^1.6.13`, in `dependencies`)
46
-
47
- ## 1.1.3-alpha.0
48
-
49
- ### Patch Changes
50
-
51
- - dependencies updates: ([#20162](https://github.com/mastra-ai/mastra/pull/20162))
52
- - Updated dependency [`better-auth@^1.6.23` ↗︎](https://www.npmjs.com/package/better-auth/v/1.6.23) (from `^1.6.13`, in `dependencies`)
53
-
54
- ## 1.1.2
55
-
56
- ### Patch Changes
57
-
58
- - Added a deferred instance mode and organization management to MastraAuthBetterAuth so it can be passed directly to a server host without a wrapper adapter. The provider can now be constructed with just a secret and will build its Better Auth instance (including running migrations) against the host database during init. It also bootstraps a personal organization for new users (ensureOrganization), checks organization admin roles (isOrganizationAdmin), and exposes the Better Auth HTTP handler (handleAuthRequest) so hosts can mount it under /auth/api/*. ([#19765](https://github.com/mastra-ai/mastra/pull/19765))
59
-
60
- **Before**
61
-
62
- ```ts
63
- import { betterAuth } from 'better-auth';
64
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
65
-
66
- const auth = new MastraAuthBetterAuth({ auth: betterAuth({/* ... */}) });
67
- ```
68
-
69
- **After** (bring-your-own instance still works)
70
-
71
- ```ts
72
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
73
-
74
- const auth = new MastraAuthBetterAuth({ secret: process.env.BETTER_AUTH_SECRET! });
75
- // host calls auth.init({ database, publicUrl, allowedOrigins }) during startup
76
- ```
77
-
78
- - Updated the minimum better-auth version to 1.6.13 to pull in the fix for a stored cross-site scripting vulnerability in better-auth's OIDC provider and MCP plugins (GHSA-86j7-9j95-vpqj). ([#19584](https://github.com/mastra-ai/mastra/pull/19584))
79
-
80
- - Fixed Better Auth bearer token authentication and implemented user lookup in `@mastra/auth-better-auth` (fixes [#19110](https://github.com/mastra-ai/mastra/issues/19110)). ([#19629](https://github.com/mastra-ai/mastra/pull/19629))
81
-
82
- **Bearer tokens now work after credentials sign-in**
83
-
84
- `signIn`/`signUp` return Better Auth's raw session token, but Better Auth only accepts _signed_ session cookies. Sending that token as `Authorization: Bearer <token>` previously always failed authentication. The provider now signs unsigned tokens with the Better Auth secret before verifying the session — matching the semantics of Better Auth's bearer plugin. The session cookie name is also resolved from the Better Auth instance, so secure-cookie setups (`__Secure-` prefix) work too.
85
-
86
- **`getUser()` and `getUsers()` are now implemented**
87
-
88
- Previously `getUser()` was a stub that always returned `null`, breaking Studio user lookup and author enrichment. It now resolves users by ID through Better Auth's internal database adapter, and `getUsers()` supports batch lookups.
89
-
90
- ## 1.1.2-alpha.2
91
-
92
- ### Patch Changes
93
-
94
- - Added a deferred instance mode and organization management to MastraAuthBetterAuth so it can be passed directly to a server host without a wrapper adapter. The provider can now be constructed with just a secret and will build its Better Auth instance (including running migrations) against the host database during init. It also bootstraps a personal organization for new users (ensureOrganization), checks organization admin roles (isOrganizationAdmin), and exposes the Better Auth HTTP handler (handleAuthRequest) so hosts can mount it under /auth/api/*. ([#19765](https://github.com/mastra-ai/mastra/pull/19765))
95
-
96
- **Before**
97
-
98
- ```ts
99
- import { betterAuth } from 'better-auth';
100
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
101
-
102
- const auth = new MastraAuthBetterAuth({ auth: betterAuth({/* ... */}) });
103
- ```
104
-
105
- **After** (bring-your-own instance still works)
106
-
107
- ```ts
108
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
109
-
110
- const auth = new MastraAuthBetterAuth({ secret: process.env.BETTER_AUTH_SECRET! });
111
- // host calls auth.init({ database, publicUrl, allowedOrigins }) during startup
112
- ```
113
-
114
- ## 1.1.2-alpha.1
115
-
116
- ### Patch Changes
117
-
118
- - Fixed Better Auth bearer token authentication and implemented user lookup in `@mastra/auth-better-auth` (fixes [#19110](https://github.com/mastra-ai/mastra/issues/19110)). ([#19629](https://github.com/mastra-ai/mastra/pull/19629))
119
-
120
- **Bearer tokens now work after credentials sign-in**
121
-
122
- `signIn`/`signUp` return Better Auth's raw session token, but Better Auth only accepts _signed_ session cookies. Sending that token as `Authorization: Bearer <token>` previously always failed authentication. The provider now signs unsigned tokens with the Better Auth secret before verifying the session — matching the semantics of Better Auth's bearer plugin. The session cookie name is also resolved from the Better Auth instance, so secure-cookie setups (`__Secure-` prefix) work too.
123
-
124
- **`getUser()` and `getUsers()` are now implemented**
125
-
126
- Previously `getUser()` was a stub that always returned `null`, breaking Studio user lookup and author enrichment. It now resolves users by ID through Better Auth's internal database adapter, and `getUsers()` supports batch lookups.
127
-
128
- ## 1.1.2-alpha.0
129
-
130
- ### Patch Changes
131
-
132
- - Updated the minimum better-auth version to 1.6.13 to pull in the fix for a stored cross-site scripting vulnerability in better-auth's OIDC provider and MCP plugins (GHSA-86j7-9j95-vpqj). ([#19584](https://github.com/mastra-ai/mastra/pull/19584))
133
-
134
- ## 1.1.1
135
-
136
- ### Patch Changes
137
-
138
- - Improved auth package builds by removing the direct core dependency from auth providers while preserving the existing public auth APIs. ([#17142](https://github.com/mastra-ai/mastra/pull/17142))
139
-
140
- ## 1.1.1-alpha.0
141
-
142
- ### Patch Changes
143
-
144
- - Improved auth package builds by removing the direct core dependency from auth providers while preserving the existing public auth APIs. ([#17142](https://github.com/mastra-ai/mastra/pull/17142))
145
-
146
- ## 1.1.0
147
-
148
- ### Minor Changes
149
-
150
- - Random bump ([#18178](https://github.com/mastra-ai/mastra/pull/18178))
151
-
152
- ### Patch Changes
153
-
154
- - Updated dependencies [[`7c0d868`](https://github.com/mastra-ai/mastra/commit/7c0d868d97d0fdbc04c14d0166dbf44d4c5a4a62), [`d9d2273`](https://github.com/mastra-ai/mastra/commit/d9d2273c702690c9a26eab2aebea879701d4355a), [`b04369d`](https://github.com/mastra-ai/mastra/commit/b04369d6b167c698ef103981171a8bf92808e756), [`8f3c262`](https://github.com/mastra-ai/mastra/commit/8f3c262587b335588a02d96b17fd6aca34c885b3)]:
155
- - @mastra/core@1.45.0
156
-
157
- ## 1.1.0-alpha.0
158
-
159
- ### Minor Changes
160
-
161
- - Random bump ([#18178](https://github.com/mastra-ai/mastra/pull/18178))
162
-
163
- ### Patch Changes
164
-
165
- - Updated dependencies [[`7c0d868`](https://github.com/mastra-ai/mastra/commit/7c0d868d97d0fdbc04c14d0166dbf44d4c5a4a62), [`d9d2273`](https://github.com/mastra-ai/mastra/commit/d9d2273c702690c9a26eab2aebea879701d4355a), [`b04369d`](https://github.com/mastra-ai/mastra/commit/b04369d6b167c698ef103981171a8bf92808e756), [`8f3c262`](https://github.com/mastra-ai/mastra/commit/8f3c262587b335588a02d96b17fd6aca34c885b3)]:
166
- - @mastra/core@1.45.0-alpha.0
167
-
168
- ## 1.0.4
169
-
170
- ### Patch Changes
171
-
172
- - Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
173
-
174
- - Updated dependencies [[`339c57c`](https://github.com/mastra-ai/mastra/commit/339c57c5b2c6dbe75a125e138228e0556528976f), [`1dd4117`](https://github.com/mastra-ai/mastra/commit/1dd4117dcbd8e031ede9f0489436bfbc6f0315b8), [`2b11d1f`](https://github.com/mastra-ai/mastra/commit/2b11d1f6ac7024c5dd2b2dd12a48a956ac9d63bd), [`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d), [`b7dff0a`](https://github.com/mastra-ai/mastra/commit/b7dff0a3d1022eb6868f48dc40a2b1febd5c277f), [`02087e1`](https://github.com/mastra-ai/mastra/commit/02087e1fbc54aa07f3071f7a200df1bf5be601a8), [`49af8df`](https://github.com/mastra-ai/mastra/commit/49af8df589c4ff71a5015a4553b377b32704b691), [`30ce559`](https://github.com/mastra-ai/mastra/commit/30ce55902ecf819b8ab8697398dd68b108228063), [`c241b92`](https://github.com/mastra-ai/mastra/commit/c241b929dc8c8d6a7b7219c99ed13ac1f3124a77), [`7d6ff70`](https://github.com/mastra-ai/mastra/commit/7d6ff708727297a0526ca0e26e93eeb5bbaaa187), [`ab975d4`](https://github.com/mastra-ai/mastra/commit/ab975d4dd9488752f05bda7afa03166d207e3e2a), [`9d6aa1b`](https://github.com/mastra-ai/mastra/commit/9d6aa1bae407e2afa6a089abc2a6accbbcb287b8)]:
175
- - @mastra/core@1.44.0
176
-
177
- ## 1.0.4-alpha.0
178
-
179
- ### Patch Changes
180
-
181
- - Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
182
-
183
- - Updated dependencies [[`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d)]:
184
- - @mastra/core@1.43.1-alpha.0
185
-
186
- ## 1.0.3
187
-
188
- ### Patch Changes
189
-
190
- - Removed Hono from @mastra/core and auth package runtime dependencies. Auth providers now receive framework-agnostic request types that support standard Request objects and Hono-compatible request shapes. MCP and deployer avoid relying on core-bundled Hono context types at package boundaries. ([#17410](https://github.com/mastra-ai/mastra/pull/17410))
191
-
192
- - Updated dependencies [[`c973db4`](https://github.com/mastra-ai/mastra/commit/c973db428df1b564ff0c35d4b2a90e8f4f1e13fd), [`552285e`](https://github.com/mastra-ai/mastra/commit/552285e5af43cfc680a0972032cab8de8776c6a0), [`77e686c`](https://github.com/mastra-ai/mastra/commit/77e686c264e493e99ae5024e4dfe3ea5d5a09718), [`ece8dba`](https://github.com/mastra-ai/mastra/commit/ece8dba7ec1a5089eee8c33167cd762bfa91e509), [`e751af2`](https://github.com/mastra-ai/mastra/commit/e751af219433fbf4c7035b2d771b4c9ec8813b05), [`e2a8380`](https://github.com/mastra-ai/mastra/commit/e2a838017a7657850404c1e94c70d79ffdc6f14a), [`be3f1cd`](https://github.com/mastra-ai/mastra/commit/be3f1cd81f0e2a649e8eac15a024d542d814aef8), [`a34d9db`](https://github.com/mastra-ai/mastra/commit/a34d9dbc39fedb722f271318e9355ecee70489ab)]:
193
- - @mastra/core@1.39.0
194
-
195
- ## 1.0.3-alpha.0
196
-
197
- ### Patch Changes
198
-
199
- - Removed Hono from @mastra/core and auth package runtime dependencies. Auth providers now receive framework-agnostic request types that support standard Request objects and Hono-compatible request shapes. MCP and deployer avoid relying on core-bundled Hono context types at package boundaries. ([#17410](https://github.com/mastra-ai/mastra/pull/17410))
200
-
201
- - Updated dependencies [[`c973db4`](https://github.com/mastra-ai/mastra/commit/c973db428df1b564ff0c35d4b2a90e8f4f1e13fd), [`552285e`](https://github.com/mastra-ai/mastra/commit/552285e5af43cfc680a0972032cab8de8776c6a0), [`77e686c`](https://github.com/mastra-ai/mastra/commit/77e686c264e493e99ae5024e4dfe3ea5d5a09718), [`ece8dba`](https://github.com/mastra-ai/mastra/commit/ece8dba7ec1a5089eee8c33167cd762bfa91e509), [`e751af2`](https://github.com/mastra-ai/mastra/commit/e751af219433fbf4c7035b2d771b4c9ec8813b05), [`e2a8380`](https://github.com/mastra-ai/mastra/commit/e2a838017a7657850404c1e94c70d79ffdc6f14a), [`be3f1cd`](https://github.com/mastra-ai/mastra/commit/be3f1cd81f0e2a649e8eac15a024d542d814aef8), [`a34d9db`](https://github.com/mastra-ai/mastra/commit/a34d9dbc39fedb722f271318e9355ecee70489ab)]:
202
- - @mastra/core@1.39.0-alpha.0
203
-
204
- ## 1.0.2
205
-
206
- ### Patch Changes
207
-
208
- - Expanded `@mastra/auth-better-auth` to implement the new auth interfaces (`IUserProvider`, `ISessionProvider`, `ICredentialsProvider`) from `@mastra/core/auth`. Adds support for username/password credential flows alongside the existing token-based authentication. ([#13163](https://github.com/mastra-ai/mastra/pull/13163))
209
-
210
- - Updated dependencies [[`504fc8b`](https://github.com/mastra-ai/mastra/commit/504fc8b9d0ddab717577ad3bf9c95ea4bd5377bd), [`f9c150b`](https://github.com/mastra-ai/mastra/commit/f9c150b7595ad05ad9cc9a11098e2944361e8c22), [`88de7e8`](https://github.com/mastra-ai/mastra/commit/88de7e8dfe4b7e1951a9e441bb33136e705ce24e), [`edee4b3`](https://github.com/mastra-ai/mastra/commit/edee4b37dff0af515fc7cc0e8d71ee39e6a762f0), [`3790c75`](https://github.com/mastra-ai/mastra/commit/3790c7578cc6a47d854eb12d89e6b1912867fe29), [`e7a235b`](https://github.com/mastra-ai/mastra/commit/e7a235be6472e0c870ed6c791ddb17c492dc188b), [`d51d298`](https://github.com/mastra-ai/mastra/commit/d51d298953967aab1f58ec965b644d109214f085), [`6dbeeb9`](https://github.com/mastra-ai/mastra/commit/6dbeeb94a8b1eebb727300d1a98961f882180794), [`d5f0d8d`](https://github.com/mastra-ai/mastra/commit/d5f0d8d6a03e515ddaa9b5da19b7e44b8357b07b), [`09c3b18`](https://github.com/mastra-ai/mastra/commit/09c3b1802ff14e243a8a8baea327440bc8cc2e32), [`b896379`](https://github.com/mastra-ai/mastra/commit/b8963791c6afa79484645fcec596a201f936b9a2), [`85c84eb`](https://github.com/mastra-ai/mastra/commit/85c84ebb78aebfcba9d209c8e152b16d7a00cb71), [`a89272a`](https://github.com/mastra-ai/mastra/commit/a89272a5d71939b9fcd284e6a6dc1dd091a6bdcf), [`ee9c8df`](https://github.com/mastra-ai/mastra/commit/ee9c8df644f19d055af5f496bf4942705f5a47b7), [`77b4a25`](https://github.com/mastra-ai/mastra/commit/77b4a254e51907f8ff3a3ba95596a18e93ae4b35), [`276246e`](https://github.com/mastra-ai/mastra/commit/276246e0b9066a1ea48bbc70df84dbe528daaf99), [`08ecfdb`](https://github.com/mastra-ai/mastra/commit/08ecfdbdad6fb8285deef86a034bdf4a6047cfca), [`d5f628c`](https://github.com/mastra-ai/mastra/commit/d5f628ca86c6f6f3ff1035d52f635df32dd81cab), [`524c0f3`](https://github.com/mastra-ai/mastra/commit/524c0f3c434c3d9d18f66338dcef383d6161b59c), [`c18a0e9`](https://github.com/mastra-ai/mastra/commit/c18a0e9cef1e4ca004b2963d35e4cfc031971eac), [`4bd21ea`](https://github.com/mastra-ai/mastra/commit/4bd21ea43d44d0a0427414fc047577f9f0aa3bec), [`115a7a4`](https://github.com/mastra-ai/mastra/commit/115a7a47db5e9896fec12ae6507501adb9ec89bf), [`22a48ae`](https://github.com/mastra-ai/mastra/commit/22a48ae2513eb54d8d79dad361fddbca97a155e8), [`3c6ef79`](https://github.com/mastra-ai/mastra/commit/3c6ef798481e00d6d22563be2de98818fd4dd5e0), [`9311c17`](https://github.com/mastra-ai/mastra/commit/9311c17d7a0640d9c4da2e71b814dc67c57c6369), [`7edf78f`](https://github.com/mastra-ai/mastra/commit/7edf78f80422c43e84585f08ba11df0d4d0b73c5), [`1c4221c`](https://github.com/mastra-ai/mastra/commit/1c4221cf6032ec98d0e094d4ee11da3e48490d96), [`d25b9ea`](https://github.com/mastra-ai/mastra/commit/d25b9eabd400167255a97b690ffbc4ee4097ded5), [`fe1ce5c`](https://github.com/mastra-ai/mastra/commit/fe1ce5c9211c03d561606fda95cbfe7df1d9a9b5), [`b03c0e0`](https://github.com/mastra-ai/mastra/commit/b03c0e0389a799523929a458b0509c9e4244d562), [`0a8366b`](https://github.com/mastra-ai/mastra/commit/0a8366b0a692fcdde56c4d526e4cf03c502ae4ac), [`85664e9`](https://github.com/mastra-ai/mastra/commit/85664e9fd857320fbc245e301f764f45f66f32a3), [`bc79650`](https://github.com/mastra-ai/mastra/commit/bc796500c6e0334faa158a96077e3fb332274869), [`9257d01`](https://github.com/mastra-ai/mastra/commit/9257d01d1366d81f84c582fe02b5e200cf9621f4), [`3a3a59e`](https://github.com/mastra-ai/mastra/commit/3a3a59e8ffaa6a985fe3d9a126a3f5ade11a6724), [`3108d4e`](https://github.com/mastra-ai/mastra/commit/3108d4e649c9fddbf03253a6feeb388a5fa9fa5a), [`0c33b2c`](https://github.com/mastra-ai/mastra/commit/0c33b2c9db537f815e1c59e2c898ffce2e395a79), [`191e5bd`](https://github.com/mastra-ai/mastra/commit/191e5bd29b82f5bda35243945790da7bc7b695c2), [`f77cd94`](https://github.com/mastra-ai/mastra/commit/f77cd94c44eabed490384e7d19232a865e13214c), [`e8135c7`](https://github.com/mastra-ai/mastra/commit/e8135c7e300dac5040670eec7eab896ac6092e30), [`daca48f`](https://github.com/mastra-ai/mastra/commit/daca48f0fb17b7ae0b62a2ac40cf0e491b2fd0b7), [`257d14f`](https://github.com/mastra-ai/mastra/commit/257d14faca5931f2e4186fc165b6f0b1f915deee), [`352f25d`](https://github.com/mastra-ai/mastra/commit/352f25da316b24cdd5b410fd8dddf6a8b763da2a), [`93477d0`](https://github.com/mastra-ai/mastra/commit/93477d0769b8a13ea5ed73d508d967fb23eaeed9), [`31c78b3`](https://github.com/mastra-ai/mastra/commit/31c78b3eb28f58a8017f1dcc795c33214d87feac), [`0bc0720`](https://github.com/mastra-ai/mastra/commit/0bc07201095791858087cc56f353fcd65e87ab54), [`36516ac`](https://github.com/mastra-ai/mastra/commit/36516aca1021cbeb42e74751b46a2614101f37c8), [`e947652`](https://github.com/mastra-ai/mastra/commit/e9476527fdecb4449e54570e80dfaf8466901254), [`3c6ef79`](https://github.com/mastra-ai/mastra/commit/3c6ef798481e00d6d22563be2de98818fd4dd5e0), [`9257d01`](https://github.com/mastra-ai/mastra/commit/9257d01d1366d81f84c582fe02b5e200cf9621f4), [`ec248f6`](https://github.com/mastra-ai/mastra/commit/ec248f6b56e8a037c066c49b2178e2507471d988)]:
211
- - @mastra/core@1.9.0
212
-
213
- ## 1.0.2-alpha.0
214
-
215
- ### Patch Changes
216
-
217
- - Expanded `@mastra/auth-better-auth` to implement the new auth interfaces (`IUserProvider`, `ISessionProvider`, `ICredentialsProvider`) from `@mastra/core/auth`. Adds support for username/password credential flows alongside the existing token-based authentication. ([#13163](https://github.com/mastra-ai/mastra/pull/13163))
218
-
219
- - Updated dependencies [[`504fc8b`](https://github.com/mastra-ai/mastra/commit/504fc8b9d0ddab717577ad3bf9c95ea4bd5377bd), [`f9c150b`](https://github.com/mastra-ai/mastra/commit/f9c150b7595ad05ad9cc9a11098e2944361e8c22), [`88de7e8`](https://github.com/mastra-ai/mastra/commit/88de7e8dfe4b7e1951a9e441bb33136e705ce24e), [`edee4b3`](https://github.com/mastra-ai/mastra/commit/edee4b37dff0af515fc7cc0e8d71ee39e6a762f0), [`3790c75`](https://github.com/mastra-ai/mastra/commit/3790c7578cc6a47d854eb12d89e6b1912867fe29), [`e7a235b`](https://github.com/mastra-ai/mastra/commit/e7a235be6472e0c870ed6c791ddb17c492dc188b), [`d51d298`](https://github.com/mastra-ai/mastra/commit/d51d298953967aab1f58ec965b644d109214f085), [`6dbeeb9`](https://github.com/mastra-ai/mastra/commit/6dbeeb94a8b1eebb727300d1a98961f882180794), [`d5f0d8d`](https://github.com/mastra-ai/mastra/commit/d5f0d8d6a03e515ddaa9b5da19b7e44b8357b07b), [`09c3b18`](https://github.com/mastra-ai/mastra/commit/09c3b1802ff14e243a8a8baea327440bc8cc2e32), [`b896379`](https://github.com/mastra-ai/mastra/commit/b8963791c6afa79484645fcec596a201f936b9a2), [`85c84eb`](https://github.com/mastra-ai/mastra/commit/85c84ebb78aebfcba9d209c8e152b16d7a00cb71), [`a89272a`](https://github.com/mastra-ai/mastra/commit/a89272a5d71939b9fcd284e6a6dc1dd091a6bdcf), [`ee9c8df`](https://github.com/mastra-ai/mastra/commit/ee9c8df644f19d055af5f496bf4942705f5a47b7), [`77b4a25`](https://github.com/mastra-ai/mastra/commit/77b4a254e51907f8ff3a3ba95596a18e93ae4b35), [`276246e`](https://github.com/mastra-ai/mastra/commit/276246e0b9066a1ea48bbc70df84dbe528daaf99), [`08ecfdb`](https://github.com/mastra-ai/mastra/commit/08ecfdbdad6fb8285deef86a034bdf4a6047cfca), [`d5f628c`](https://github.com/mastra-ai/mastra/commit/d5f628ca86c6f6f3ff1035d52f635df32dd81cab), [`524c0f3`](https://github.com/mastra-ai/mastra/commit/524c0f3c434c3d9d18f66338dcef383d6161b59c), [`c18a0e9`](https://github.com/mastra-ai/mastra/commit/c18a0e9cef1e4ca004b2963d35e4cfc031971eac), [`4bd21ea`](https://github.com/mastra-ai/mastra/commit/4bd21ea43d44d0a0427414fc047577f9f0aa3bec), [`115a7a4`](https://github.com/mastra-ai/mastra/commit/115a7a47db5e9896fec12ae6507501adb9ec89bf), [`22a48ae`](https://github.com/mastra-ai/mastra/commit/22a48ae2513eb54d8d79dad361fddbca97a155e8), [`3c6ef79`](https://github.com/mastra-ai/mastra/commit/3c6ef798481e00d6d22563be2de98818fd4dd5e0), [`9311c17`](https://github.com/mastra-ai/mastra/commit/9311c17d7a0640d9c4da2e71b814dc67c57c6369), [`7edf78f`](https://github.com/mastra-ai/mastra/commit/7edf78f80422c43e84585f08ba11df0d4d0b73c5), [`1c4221c`](https://github.com/mastra-ai/mastra/commit/1c4221cf6032ec98d0e094d4ee11da3e48490d96), [`d25b9ea`](https://github.com/mastra-ai/mastra/commit/d25b9eabd400167255a97b690ffbc4ee4097ded5), [`fe1ce5c`](https://github.com/mastra-ai/mastra/commit/fe1ce5c9211c03d561606fda95cbfe7df1d9a9b5), [`b03c0e0`](https://github.com/mastra-ai/mastra/commit/b03c0e0389a799523929a458b0509c9e4244d562), [`0a8366b`](https://github.com/mastra-ai/mastra/commit/0a8366b0a692fcdde56c4d526e4cf03c502ae4ac), [`85664e9`](https://github.com/mastra-ai/mastra/commit/85664e9fd857320fbc245e301f764f45f66f32a3), [`bc79650`](https://github.com/mastra-ai/mastra/commit/bc796500c6e0334faa158a96077e3fb332274869), [`9257d01`](https://github.com/mastra-ai/mastra/commit/9257d01d1366d81f84c582fe02b5e200cf9621f4), [`3a3a59e`](https://github.com/mastra-ai/mastra/commit/3a3a59e8ffaa6a985fe3d9a126a3f5ade11a6724), [`3108d4e`](https://github.com/mastra-ai/mastra/commit/3108d4e649c9fddbf03253a6feeb388a5fa9fa5a), [`0c33b2c`](https://github.com/mastra-ai/mastra/commit/0c33b2c9db537f815e1c59e2c898ffce2e395a79), [`191e5bd`](https://github.com/mastra-ai/mastra/commit/191e5bd29b82f5bda35243945790da7bc7b695c2), [`f77cd94`](https://github.com/mastra-ai/mastra/commit/f77cd94c44eabed490384e7d19232a865e13214c), [`e8135c7`](https://github.com/mastra-ai/mastra/commit/e8135c7e300dac5040670eec7eab896ac6092e30), [`daca48f`](https://github.com/mastra-ai/mastra/commit/daca48f0fb17b7ae0b62a2ac40cf0e491b2fd0b7), [`257d14f`](https://github.com/mastra-ai/mastra/commit/257d14faca5931f2e4186fc165b6f0b1f915deee), [`352f25d`](https://github.com/mastra-ai/mastra/commit/352f25da316b24cdd5b410fd8dddf6a8b763da2a), [`93477d0`](https://github.com/mastra-ai/mastra/commit/93477d0769b8a13ea5ed73d508d967fb23eaeed9), [`31c78b3`](https://github.com/mastra-ai/mastra/commit/31c78b3eb28f58a8017f1dcc795c33214d87feac), [`0bc0720`](https://github.com/mastra-ai/mastra/commit/0bc07201095791858087cc56f353fcd65e87ab54), [`36516ac`](https://github.com/mastra-ai/mastra/commit/36516aca1021cbeb42e74751b46a2614101f37c8), [`e947652`](https://github.com/mastra-ai/mastra/commit/e9476527fdecb4449e54570e80dfaf8466901254), [`3c6ef79`](https://github.com/mastra-ai/mastra/commit/3c6ef798481e00d6d22563be2de98818fd4dd5e0), [`9257d01`](https://github.com/mastra-ai/mastra/commit/9257d01d1366d81f84c582fe02b5e200cf9621f4), [`ec248f6`](https://github.com/mastra-ai/mastra/commit/ec248f6b56e8a037c066c49b2178e2507471d988)]:
220
- - @mastra/core@1.9.0-alpha.0
221
-
222
- ## 1.0.1
223
-
224
- ### Patch Changes
225
-
226
- - dependencies updates: ([#12964](https://github.com/mastra-ai/mastra/pull/12964))
227
- - Updated dependency [`better-auth@^1.4.18` ↗︎](https://www.npmjs.com/package/better-auth/v/1.4.18) (from `^1.4.5`, in `dependencies`)
228
-
229
- ## 1.0.1-alpha.0
230
-
231
- ### Patch Changes
232
-
233
- - dependencies updates: ([#12964](https://github.com/mastra-ai/mastra/pull/12964))
234
- - Updated dependency [`better-auth@^1.4.18` ↗︎](https://www.npmjs.com/package/better-auth/v/1.4.18) (from `^1.4.5`, in `dependencies`)
235
-
236
- ## 1.0.0
237
-
238
- ### Minor Changes
239
-
240
- - Add Better Auth authentication provider ([#10658](https://github.com/mastra-ai/mastra/pull/10658))
241
-
242
- Adds a new authentication provider for Better Auth, a self-hosted, open-source authentication framework.
243
-
244
- ```typescript
245
- import { betterAuth } from 'better-auth';
246
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
247
- import { Mastra } from '@mastra/core';
248
-
249
- // Create your Better Auth instance
250
- const auth = betterAuth({
251
- database: {
252
- provider: 'postgresql',
253
- url: process.env.DATABASE_URL!,
254
- },
255
- emailAndPassword: {
256
- enabled: true,
257
- },
258
- });
259
-
260
- // Create the Mastra auth provider
261
- const mastraAuth = new MastraAuthBetterAuth({
262
- auth,
263
- });
264
-
265
- // Use with Mastra
266
- const mastra = new Mastra({
267
- server: {
268
- auth: mastraAuth,
269
- },
270
- });
271
- ```
272
-
273
- ## 1.0.0-beta.2
274
-
275
- ### Minor Changes
276
-
277
- - Add Better Auth authentication provider ([#10658](https://github.com/mastra-ai/mastra/pull/10658))
278
-
279
- Adds a new authentication provider for Better Auth, a self-hosted, open-source authentication framework.
280
-
281
- ```typescript
282
- import { betterAuth } from 'better-auth';
283
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
284
- import { Mastra } from '@mastra/core';
285
-
286
- // Create your Better Auth instance
287
- const auth = betterAuth({
288
- database: {
289
- provider: 'postgresql',
290
- url: process.env.DATABASE_URL!,
291
- },
292
- emailAndPassword: {
293
- enabled: true,
294
- },
295
- });
296
-
297
- // Create the Mastra auth provider
298
- const mastraAuth = new MastraAuthBetterAuth({
299
- auth,
300
- });
301
-
302
- // Use with Mastra
303
- const mastra = new Mastra({
304
- server: {
305
- auth: mastraAuth,
306
- },
307
- });
308
- ```
309
-
310
- ## 1.0.0-beta.1
311
-
312
- ### Major Changes
313
-
314
- - Initial release of Better Auth integration for Mastra
315
- - Self-hosted authentication provider using Better Auth
316
- - Support for session-based authentication
317
- - Custom authorization logic support
318
- - Route configuration for public/protected paths
@@ -1,218 +0,0 @@
1
- import { Transform } from "stream";
2
- //#region src/logger/index.d.ts
3
- declare const RegisteredLogger: {
4
- readonly AGENT: "AGENT";
5
- readonly OBSERVABILITY: "OBSERVABILITY";
6
- readonly AUTH: "AUTH";
7
- readonly BROWSER: "BROWSER";
8
- readonly NETWORK: "NETWORK";
9
- readonly WORKFLOW: "WORKFLOW";
10
- readonly LLM: "LLM";
11
- readonly TTS: "TTS";
12
- readonly VOICE: "VOICE";
13
- readonly VECTOR: "VECTOR";
14
- readonly BUNDLER: "BUNDLER";
15
- readonly DEPLOYER: "DEPLOYER";
16
- readonly MEMORY: "MEMORY";
17
- readonly STORAGE: "STORAGE";
18
- readonly EMBEDDINGS: "EMBEDDINGS";
19
- readonly MCP_SERVER: "MCP_SERVER";
20
- readonly SERVER_CACHE: "SERVER_CACHE";
21
- readonly SERVER: "SERVER";
22
- readonly WORKSPACE: "WORKSPACE";
23
- readonly CHANNEL: "CHANNEL";
24
- };
25
- type RegisteredLogger = (typeof RegisteredLogger)[keyof typeof RegisteredLogger];
26
- declare const LogLevel: {
27
- readonly DEBUG: "debug";
28
- readonly INFO: "info";
29
- readonly WARN: "warn";
30
- readonly ERROR: "error";
31
- readonly NONE: "silent";
32
- };
33
- type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
34
- interface BaseLogMessage {
35
- runId?: string;
36
- msg: string;
37
- level: LogLevel;
38
- time: Date;
39
- pid: number;
40
- hostname: string;
41
- name: string;
42
- }
43
- declare abstract class LoggerTransport extends Transform {
44
- constructor(opts?: any);
45
- listLogsByRunId(_args: {
46
- runId: string;
47
- fromDate?: Date;
48
- toDate?: Date;
49
- logLevel?: LogLevel;
50
- filters?: Record<string, any>;
51
- page?: number;
52
- perPage?: number;
53
- }): Promise<{
54
- logs: BaseLogMessage[];
55
- total: number;
56
- page: number;
57
- perPage: number;
58
- hasMore: boolean;
59
- }>;
60
- listLogs(_args?: {
61
- fromDate?: Date;
62
- toDate?: Date;
63
- logLevel?: LogLevel;
64
- filters?: Record<string, any>;
65
- returnPaginationResults?: boolean;
66
- page?: number;
67
- perPage?: number;
68
- }): Promise<{
69
- logs: BaseLogMessage[];
70
- total: number;
71
- page: number;
72
- perPage: number;
73
- hasMore: boolean;
74
- }>;
75
- }
76
- declare const createCustomTransport: (stream: Transform, listLogs?: LoggerTransport["listLogs"], listLogsByRunId?: LoggerTransport["listLogsByRunId"]) => LoggerTransport;
77
- interface IMastraLogger {
78
- debug(message: string, ...args: any[]): void;
79
- info(message: string, ...args: any[]): void;
80
- warn(message: string, ...args: any[]): void;
81
- error(message: string, ...args: any[]): void;
82
- trackException(error: Error, metadata?: Record<string, unknown>): void;
83
- getTransports(): Map<string, LoggerTransport>;
84
- listLogs(_transportId: string, _params?: {
85
- fromDate?: Date;
86
- toDate?: Date;
87
- logLevel?: LogLevel;
88
- filters?: Record<string, any>;
89
- page?: number;
90
- perPage?: number;
91
- }): Promise<{
92
- logs: BaseLogMessage[];
93
- total: number;
94
- page: number;
95
- perPage: number;
96
- hasMore: boolean;
97
- }>;
98
- listLogsByRunId(_args: {
99
- transportId: string;
100
- runId: string;
101
- fromDate?: Date;
102
- toDate?: Date;
103
- logLevel?: LogLevel;
104
- filters?: Record<string, any>;
105
- page?: number;
106
- perPage?: number;
107
- }): Promise<{
108
- logs: BaseLogMessage[];
109
- total: number;
110
- page: number;
111
- perPage: number;
112
- hasMore: boolean;
113
- }>;
114
- }
115
- declare abstract class MastraLogger implements IMastraLogger {
116
- protected name: string;
117
- protected level: LogLevel;
118
- protected transports: Map<string, LoggerTransport>;
119
- constructor(options?: {
120
- name?: string;
121
- level?: LogLevel;
122
- transports?: Record<string, LoggerTransport>;
123
- });
124
- abstract debug(message: string, ...args: any[]): void;
125
- abstract info(message: string, ...args: any[]): void;
126
- abstract warn(message: string, ...args: any[]): void;
127
- abstract error(message: string, ...args: any[]): void;
128
- getTransports(): Map<string, LoggerTransport>;
129
- trackException(_error: Error, _metadata?: Record<string, unknown>): void;
130
- listLogs(transportId: string, params?: {
131
- fromDate?: Date;
132
- toDate?: Date;
133
- logLevel?: LogLevel;
134
- filters?: Record<string, any>;
135
- page?: number;
136
- perPage?: number;
137
- }): Promise<{
138
- logs: BaseLogMessage[];
139
- total: number;
140
- page: number;
141
- perPage: number;
142
- hasMore: boolean;
143
- }>;
144
- listLogsByRunId({ transportId, runId, fromDate, toDate, logLevel, filters, page, perPage }: {
145
- transportId: string;
146
- runId: string;
147
- fromDate?: Date;
148
- toDate?: Date;
149
- logLevel?: LogLevel;
150
- filters?: Record<string, any>;
151
- page?: number;
152
- perPage?: number;
153
- }): Promise<{
154
- logs: BaseLogMessage[];
155
- total: number;
156
- page: number;
157
- perPage: number;
158
- hasMore: boolean;
159
- }>;
160
- }
161
- type LogFilterContext = {
162
- component?: RegisteredLogger;
163
- level: LogLevel;
164
- message: string;
165
- args: unknown[];
166
- };
167
- type LogFilter = (ctx: LogFilterContext) => boolean;
168
- interface ConsoleLoggerOptions {
169
- name?: string;
170
- level?: LogLevel;
171
- component?: RegisteredLogger;
172
- filter?: LogFilter;
173
- }
174
- declare class ConsoleLogger extends MastraLogger {
175
- protected component?: RegisteredLogger;
176
- protected filter?: LogFilter;
177
- constructor(options?: ConsoleLoggerOptions);
178
- child(componentOrBindings: RegisteredLogger | Record<string, unknown>): ConsoleLogger;
179
- private shouldLog;
180
- private prefix;
181
- debug(message: string, ...args: any[]): void;
182
- info(message: string, ...args: any[]): void;
183
- warn(message: string, ...args: any[]): void;
184
- error(message: string, ...args: any[]): void;
185
- listLogs(_transportId: string, _params?: {
186
- fromDate?: Date;
187
- toDate?: Date;
188
- logLevel?: LogLevel;
189
- filters?: Record<string, any>;
190
- page?: number;
191
- perPage?: number;
192
- }): Promise<{
193
- logs: never[];
194
- total: number;
195
- page: number;
196
- perPage: number;
197
- hasMore: boolean;
198
- }>;
199
- listLogsByRunId(_args: {
200
- transportId: string;
201
- runId: string;
202
- fromDate?: Date;
203
- toDate?: Date;
204
- logLevel?: LogLevel;
205
- filters?: Record<string, any>;
206
- page?: number;
207
- perPage?: number;
208
- }): Promise<{
209
- logs: never[];
210
- total: number;
211
- page: number;
212
- perPage: number;
213
- hasMore: boolean;
214
- }>;
215
- }
216
- //#endregion
217
- export { LogFilter as a, LoggerTransport as c, createCustomTransport as d, IMastraLogger as i, MastraLogger as l, ConsoleLogger as n, LogFilterContext as o, ConsoleLoggerOptions as r, LogLevel as s, BaseLogMessage as t, RegisteredLogger as u };
218
- //# sourceMappingURL=index-S1lgaKO7.d.ts.map