@mastra/auth-better-auth 1.1.4-alpha.1 → 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,297 +0,0 @@
1
- # @mastra/auth-better-auth
2
-
3
- ## 1.1.4-alpha.1
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
- 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.
10
-
11
- ## 1.1.4-alpha.0
12
-
13
- ### Patch Changes
14
-
15
- - 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))
16
-
17
- Related to https://github.com/mastra-ai/mastra/issues/21253
18
-
19
- ## 1.1.3
20
-
21
- ### Patch Changes
22
-
23
- - dependencies updates: ([#20162](https://github.com/mastra-ai/mastra/pull/20162))
24
- - Updated dependency [`better-auth@^1.6.23` ↗︎](https://www.npmjs.com/package/better-auth/v/1.6.23) (from `^1.6.13`, in `dependencies`)
25
-
26
- ## 1.1.3-alpha.0
27
-
28
- ### Patch Changes
29
-
30
- - dependencies updates: ([#20162](https://github.com/mastra-ai/mastra/pull/20162))
31
- - Updated dependency [`better-auth@^1.6.23` ↗︎](https://www.npmjs.com/package/better-auth/v/1.6.23) (from `^1.6.13`, in `dependencies`)
32
-
33
- ## 1.1.2
34
-
35
- ### Patch Changes
36
-
37
- - 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))
38
-
39
- **Before**
40
-
41
- ```ts
42
- import { betterAuth } from 'better-auth';
43
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
44
-
45
- const auth = new MastraAuthBetterAuth({ auth: betterAuth({/* ... */}) });
46
- ```
47
-
48
- **After** (bring-your-own instance still works)
49
-
50
- ```ts
51
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
52
-
53
- const auth = new MastraAuthBetterAuth({ secret: process.env.BETTER_AUTH_SECRET! });
54
- // host calls auth.init({ database, publicUrl, allowedOrigins }) during startup
55
- ```
56
-
57
- - 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))
58
-
59
- - 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))
60
-
61
- **Bearer tokens now work after credentials sign-in**
62
-
63
- `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.
64
-
65
- **`getUser()` and `getUsers()` are now implemented**
66
-
67
- 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.
68
-
69
- ## 1.1.2-alpha.2
70
-
71
- ### Patch Changes
72
-
73
- - 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))
74
-
75
- **Before**
76
-
77
- ```ts
78
- import { betterAuth } from 'better-auth';
79
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
80
-
81
- const auth = new MastraAuthBetterAuth({ auth: betterAuth({/* ... */}) });
82
- ```
83
-
84
- **After** (bring-your-own instance still works)
85
-
86
- ```ts
87
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
88
-
89
- const auth = new MastraAuthBetterAuth({ secret: process.env.BETTER_AUTH_SECRET! });
90
- // host calls auth.init({ database, publicUrl, allowedOrigins }) during startup
91
- ```
92
-
93
- ## 1.1.2-alpha.1
94
-
95
- ### Patch Changes
96
-
97
- - 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))
98
-
99
- **Bearer tokens now work after credentials sign-in**
100
-
101
- `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.
102
-
103
- **`getUser()` and `getUsers()` are now implemented**
104
-
105
- 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.
106
-
107
- ## 1.1.2-alpha.0
108
-
109
- ### Patch Changes
110
-
111
- - 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))
112
-
113
- ## 1.1.1
114
-
115
- ### Patch Changes
116
-
117
- - 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))
118
-
119
- ## 1.1.1-alpha.0
120
-
121
- ### Patch Changes
122
-
123
- - 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))
124
-
125
- ## 1.1.0
126
-
127
- ### Minor Changes
128
-
129
- - Random bump ([#18178](https://github.com/mastra-ai/mastra/pull/18178))
130
-
131
- ### Patch Changes
132
-
133
- - 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)]:
134
- - @mastra/core@1.45.0
135
-
136
- ## 1.1.0-alpha.0
137
-
138
- ### Minor Changes
139
-
140
- - Random bump ([#18178](https://github.com/mastra-ai/mastra/pull/18178))
141
-
142
- ### Patch Changes
143
-
144
- - 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)]:
145
- - @mastra/core@1.45.0-alpha.0
146
-
147
- ## 1.0.4
148
-
149
- ### Patch Changes
150
-
151
- - 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))
152
-
153
- - 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)]:
154
- - @mastra/core@1.44.0
155
-
156
- ## 1.0.4-alpha.0
157
-
158
- ### Patch Changes
159
-
160
- - 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))
161
-
162
- - Updated dependencies [[`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d)]:
163
- - @mastra/core@1.43.1-alpha.0
164
-
165
- ## 1.0.3
166
-
167
- ### Patch Changes
168
-
169
- - 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))
170
-
171
- - 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)]:
172
- - @mastra/core@1.39.0
173
-
174
- ## 1.0.3-alpha.0
175
-
176
- ### Patch Changes
177
-
178
- - 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))
179
-
180
- - 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)]:
181
- - @mastra/core@1.39.0-alpha.0
182
-
183
- ## 1.0.2
184
-
185
- ### Patch Changes
186
-
187
- - 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))
188
-
189
- - 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)]:
190
- - @mastra/core@1.9.0
191
-
192
- ## 1.0.2-alpha.0
193
-
194
- ### Patch Changes
195
-
196
- - 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))
197
-
198
- - 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)]:
199
- - @mastra/core@1.9.0-alpha.0
200
-
201
- ## 1.0.1
202
-
203
- ### Patch Changes
204
-
205
- - dependencies updates: ([#12964](https://github.com/mastra-ai/mastra/pull/12964))
206
- - Updated dependency [`better-auth@^1.4.18` ↗︎](https://www.npmjs.com/package/better-auth/v/1.4.18) (from `^1.4.5`, in `dependencies`)
207
-
208
- ## 1.0.1-alpha.0
209
-
210
- ### Patch Changes
211
-
212
- - dependencies updates: ([#12964](https://github.com/mastra-ai/mastra/pull/12964))
213
- - Updated dependency [`better-auth@^1.4.18` ↗︎](https://www.npmjs.com/package/better-auth/v/1.4.18) (from `^1.4.5`, in `dependencies`)
214
-
215
- ## 1.0.0
216
-
217
- ### Minor Changes
218
-
219
- - Add Better Auth authentication provider ([#10658](https://github.com/mastra-ai/mastra/pull/10658))
220
-
221
- Adds a new authentication provider for Better Auth, a self-hosted, open-source authentication framework.
222
-
223
- ```typescript
224
- import { betterAuth } from 'better-auth';
225
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
226
- import { Mastra } from '@mastra/core';
227
-
228
- // Create your Better Auth instance
229
- const auth = betterAuth({
230
- database: {
231
- provider: 'postgresql',
232
- url: process.env.DATABASE_URL!,
233
- },
234
- emailAndPassword: {
235
- enabled: true,
236
- },
237
- });
238
-
239
- // Create the Mastra auth provider
240
- const mastraAuth = new MastraAuthBetterAuth({
241
- auth,
242
- });
243
-
244
- // Use with Mastra
245
- const mastra = new Mastra({
246
- server: {
247
- auth: mastraAuth,
248
- },
249
- });
250
- ```
251
-
252
- ## 1.0.0-beta.2
253
-
254
- ### Minor Changes
255
-
256
- - Add Better Auth authentication provider ([#10658](https://github.com/mastra-ai/mastra/pull/10658))
257
-
258
- Adds a new authentication provider for Better Auth, a self-hosted, open-source authentication framework.
259
-
260
- ```typescript
261
- import { betterAuth } from 'better-auth';
262
- import { MastraAuthBetterAuth } from '@mastra/auth-better-auth';
263
- import { Mastra } from '@mastra/core';
264
-
265
- // Create your Better Auth instance
266
- const auth = betterAuth({
267
- database: {
268
- provider: 'postgresql',
269
- url: process.env.DATABASE_URL!,
270
- },
271
- emailAndPassword: {
272
- enabled: true,
273
- },
274
- });
275
-
276
- // Create the Mastra auth provider
277
- const mastraAuth = new MastraAuthBetterAuth({
278
- auth,
279
- });
280
-
281
- // Use with Mastra
282
- const mastra = new Mastra({
283
- server: {
284
- auth: mastraAuth,
285
- },
286
- });
287
- ```
288
-
289
- ## 1.0.0-beta.1
290
-
291
- ### Major Changes
292
-
293
- - Initial release of Better Auth integration for Mastra
294
- - Self-hosted authentication provider using Better Auth
295
- - Support for session-based authentication
296
- - Custom authorization logic support
297
- - 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