@better-auth/core 1.5.7-beta.1 → 1.6.0-beta.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.
Files changed (273) hide show
  1. package/dist/api/index.d.mts +1 -2
  2. package/dist/api/index.mjs +0 -3
  3. package/dist/async_hooks/index.d.mts +1 -2
  4. package/dist/async_hooks/index.mjs +0 -2
  5. package/dist/async_hooks/pure.index.d.mts +1 -2
  6. package/dist/async_hooks/pure.index.mjs +0 -2
  7. package/dist/context/endpoint-context.d.mts +1 -2
  8. package/dist/context/endpoint-context.mjs +0 -2
  9. package/dist/context/global.d.mts +1 -2
  10. package/dist/context/global.mjs +1 -3
  11. package/dist/context/request-state.d.mts +1 -2
  12. package/dist/context/request-state.mjs +0 -2
  13. package/dist/context/transaction.d.mts +1 -2
  14. package/dist/context/transaction.mjs +0 -2
  15. package/dist/db/adapter/factory.d.mts +1 -2
  16. package/dist/db/adapter/factory.mjs +3 -6
  17. package/dist/db/adapter/get-default-field-name.d.mts +1 -2
  18. package/dist/db/adapter/get-default-field-name.mjs +0 -2
  19. package/dist/db/adapter/get-default-model-name.d.mts +1 -2
  20. package/dist/db/adapter/get-default-model-name.mjs +0 -2
  21. package/dist/db/adapter/get-field-attributes.d.mts +1 -2
  22. package/dist/db/adapter/get-field-attributes.mjs +0 -2
  23. package/dist/db/adapter/get-field-name.d.mts +1 -2
  24. package/dist/db/adapter/get-field-name.mjs +0 -2
  25. package/dist/db/adapter/get-id-field.d.mts +1 -2
  26. package/dist/db/adapter/get-id-field.mjs +0 -3
  27. package/dist/db/adapter/get-model-name.d.mts +1 -2
  28. package/dist/db/adapter/get-model-name.mjs +0 -2
  29. package/dist/db/adapter/index.d.mts +9 -2
  30. package/dist/db/adapter/index.mjs +0 -2
  31. package/dist/db/adapter/types.d.mts +1 -2
  32. package/dist/db/adapter/utils.d.mts +1 -2
  33. package/dist/db/adapter/utils.mjs +0 -2
  34. package/dist/db/get-tables.d.mts +1 -2
  35. package/dist/db/get-tables.mjs +0 -2
  36. package/dist/db/plugin.d.mts +1 -2
  37. package/dist/db/schema/account.d.mts +1 -2
  38. package/dist/db/schema/account.mjs +0 -2
  39. package/dist/db/schema/rate-limit.d.mts +1 -2
  40. package/dist/db/schema/rate-limit.mjs +0 -2
  41. package/dist/db/schema/session.d.mts +1 -2
  42. package/dist/db/schema/session.mjs +0 -2
  43. package/dist/db/schema/shared.d.mts +1 -2
  44. package/dist/db/schema/shared.mjs +0 -2
  45. package/dist/db/schema/user.d.mts +1 -2
  46. package/dist/db/schema/user.mjs +0 -2
  47. package/dist/db/schema/verification.d.mts +1 -2
  48. package/dist/db/schema/verification.mjs +0 -2
  49. package/dist/db/type.d.mts +1 -2
  50. package/dist/env/color-depth.d.mts +1 -2
  51. package/dist/env/color-depth.mjs +0 -2
  52. package/dist/env/env-impl.d.mts +1 -2
  53. package/dist/env/env-impl.mjs +0 -2
  54. package/dist/env/logger.d.mts +1 -2
  55. package/dist/env/logger.mjs +0 -2
  56. package/dist/error/codes.d.mts +1 -2
  57. package/dist/error/codes.mjs +0 -2
  58. package/dist/error/index.d.mts +1 -2
  59. package/dist/error/index.mjs +0 -2
  60. package/dist/instrumentation/attributes.d.mts +1 -2
  61. package/dist/instrumentation/attributes.mjs +0 -2
  62. package/dist/instrumentation/tracer.d.mts +1 -2
  63. package/dist/instrumentation/tracer.mjs +29 -15
  64. package/dist/oauth2/client-credentials-token.d.mts +1 -2
  65. package/dist/oauth2/client-credentials-token.mjs +0 -2
  66. package/dist/oauth2/create-authorization-url.d.mts +1 -2
  67. package/dist/oauth2/create-authorization-url.mjs +0 -2
  68. package/dist/oauth2/oauth-provider.d.mts +1 -2
  69. package/dist/oauth2/refresh-access-token.d.mts +1 -2
  70. package/dist/oauth2/refresh-access-token.mjs +0 -2
  71. package/dist/oauth2/utils.d.mts +1 -2
  72. package/dist/oauth2/utils.mjs +0 -2
  73. package/dist/oauth2/validate-authorization-code.d.mts +1 -2
  74. package/dist/oauth2/validate-authorization-code.mjs +0 -3
  75. package/dist/oauth2/verify.d.mts +1 -2
  76. package/dist/oauth2/verify.mjs +0 -3
  77. package/dist/social-providers/apple.d.mts +1 -2
  78. package/dist/social-providers/apple.mjs +0 -3
  79. package/dist/social-providers/atlassian.d.mts +1 -2
  80. package/dist/social-providers/atlassian.mjs +0 -4
  81. package/dist/social-providers/cognito.d.mts +1 -2
  82. package/dist/social-providers/cognito.mjs +0 -4
  83. package/dist/social-providers/discord.d.mts +1 -2
  84. package/dist/social-providers/discord.mjs +0 -3
  85. package/dist/social-providers/dropbox.d.mts +1 -2
  86. package/dist/social-providers/dropbox.mjs +0 -3
  87. package/dist/social-providers/facebook.d.mts +1 -2
  88. package/dist/social-providers/facebook.mjs +0 -3
  89. package/dist/social-providers/figma.d.mts +1 -2
  90. package/dist/social-providers/figma.mjs +0 -4
  91. package/dist/social-providers/github.d.mts +1 -2
  92. package/dist/social-providers/github.mjs +0 -4
  93. package/dist/social-providers/gitlab.d.mts +1 -2
  94. package/dist/social-providers/gitlab.mjs +0 -3
  95. package/dist/social-providers/google.d.mts +1 -2
  96. package/dist/social-providers/google.mjs +0 -4
  97. package/dist/social-providers/huggingface.d.mts +1 -2
  98. package/dist/social-providers/huggingface.mjs +0 -3
  99. package/dist/social-providers/index.d.mts +1 -2
  100. package/dist/social-providers/index.mjs +0 -2
  101. package/dist/social-providers/kakao.d.mts +1 -2
  102. package/dist/social-providers/kakao.mjs +0 -3
  103. package/dist/social-providers/kick.d.mts +1 -2
  104. package/dist/social-providers/kick.mjs +0 -3
  105. package/dist/social-providers/line.d.mts +1 -2
  106. package/dist/social-providers/line.mjs +0 -3
  107. package/dist/social-providers/linear.d.mts +1 -2
  108. package/dist/social-providers/linear.mjs +0 -3
  109. package/dist/social-providers/linkedin.d.mts +1 -2
  110. package/dist/social-providers/linkedin.mjs +0 -3
  111. package/dist/social-providers/microsoft-entra-id.d.mts +1 -2
  112. package/dist/social-providers/microsoft-entra-id.mjs +0 -4
  113. package/dist/social-providers/naver.d.mts +1 -2
  114. package/dist/social-providers/naver.mjs +0 -3
  115. package/dist/social-providers/notion.d.mts +1 -2
  116. package/dist/social-providers/notion.mjs +0 -3
  117. package/dist/social-providers/paybin.d.mts +1 -2
  118. package/dist/social-providers/paybin.mjs +0 -4
  119. package/dist/social-providers/paypal.d.mts +1 -2
  120. package/dist/social-providers/paypal.mjs +0 -4
  121. package/dist/social-providers/polar.d.mts +1 -2
  122. package/dist/social-providers/polar.mjs +0 -3
  123. package/dist/social-providers/railway.d.mts +1 -2
  124. package/dist/social-providers/railway.mjs +0 -3
  125. package/dist/social-providers/reddit.d.mts +1 -2
  126. package/dist/social-providers/reddit.mjs +0 -3
  127. package/dist/social-providers/roblox.d.mts +1 -2
  128. package/dist/social-providers/roblox.mjs +0 -3
  129. package/dist/social-providers/salesforce.d.mts +1 -2
  130. package/dist/social-providers/salesforce.mjs +0 -4
  131. package/dist/social-providers/slack.d.mts +1 -2
  132. package/dist/social-providers/slack.mjs +0 -3
  133. package/dist/social-providers/spotify.d.mts +1 -2
  134. package/dist/social-providers/spotify.mjs +0 -3
  135. package/dist/social-providers/tiktok.d.mts +1 -2
  136. package/dist/social-providers/tiktok.mjs +0 -3
  137. package/dist/social-providers/twitch.d.mts +1 -2
  138. package/dist/social-providers/twitch.mjs +0 -4
  139. package/dist/social-providers/twitter.d.mts +1 -2
  140. package/dist/social-providers/twitter.mjs +0 -3
  141. package/dist/social-providers/vercel.d.mts +1 -2
  142. package/dist/social-providers/vercel.mjs +0 -3
  143. package/dist/social-providers/vk.d.mts +1 -2
  144. package/dist/social-providers/vk.mjs +0 -3
  145. package/dist/social-providers/wechat.d.mts +1 -2
  146. package/dist/social-providers/wechat.mjs +0 -2
  147. package/dist/social-providers/zoom.d.mts +1 -2
  148. package/dist/social-providers/zoom.mjs +0 -3
  149. package/dist/types/context.d.mts +2 -2
  150. package/dist/types/cookie.d.mts +1 -2
  151. package/dist/types/helper.d.mts +1 -2
  152. package/dist/types/init-options.d.mts +14 -6
  153. package/dist/types/plugin-client.d.mts +2 -2
  154. package/dist/types/plugin.d.mts +2 -2
  155. package/dist/types/secret.d.mts +1 -2
  156. package/dist/utils/db.d.mts +1 -2
  157. package/dist/utils/db.mjs +0 -2
  158. package/dist/utils/deprecate.d.mts +1 -2
  159. package/dist/utils/deprecate.mjs +0 -2
  160. package/dist/utils/error-codes.d.mts +1 -2
  161. package/dist/utils/error-codes.mjs +0 -2
  162. package/dist/utils/fetch-metadata.d.mts +1 -2
  163. package/dist/utils/fetch-metadata.mjs +0 -2
  164. package/dist/utils/id.d.mts +1 -2
  165. package/dist/utils/id.mjs +0 -2
  166. package/dist/utils/ip.d.mts +1 -2
  167. package/dist/utils/ip.mjs +0 -2
  168. package/dist/utils/json.d.mts +1 -2
  169. package/dist/utils/json.mjs +0 -3
  170. package/dist/utils/string.d.mts +1 -2
  171. package/dist/utils/string.mjs +0 -2
  172. package/dist/utils/url.d.mts +1 -2
  173. package/dist/utils/url.mjs +0 -2
  174. package/package.json +9 -7
  175. package/src/db/adapter/factory.ts +2 -0
  176. package/src/db/adapter/index.ts +8 -0
  177. package/src/instrumentation/tracer.ts +40 -12
  178. package/src/social-providers/index.ts +0 -2
  179. package/src/types/context.ts +1 -0
  180. package/src/types/init-options.ts +13 -4
  181. package/src/types/plugin-client.ts +1 -0
  182. package/src/types/plugin.ts +1 -0
  183. package/dist/api/index.mjs.map +0 -1
  184. package/dist/async_hooks/index.mjs.map +0 -1
  185. package/dist/async_hooks/pure.index.mjs.map +0 -1
  186. package/dist/context/endpoint-context.mjs.map +0 -1
  187. package/dist/context/global.mjs.map +0 -1
  188. package/dist/context/request-state.mjs.map +0 -1
  189. package/dist/context/transaction.mjs.map +0 -1
  190. package/dist/db/adapter/factory.mjs.map +0 -1
  191. package/dist/db/adapter/get-default-field-name.mjs.map +0 -1
  192. package/dist/db/adapter/get-default-model-name.mjs.map +0 -1
  193. package/dist/db/adapter/get-field-attributes.mjs.map +0 -1
  194. package/dist/db/adapter/get-field-name.mjs.map +0 -1
  195. package/dist/db/adapter/get-id-field.mjs.map +0 -1
  196. package/dist/db/adapter/get-model-name.mjs.map +0 -1
  197. package/dist/db/adapter/index.mjs.map +0 -1
  198. package/dist/db/adapter/utils.mjs.map +0 -1
  199. package/dist/db/get-tables.mjs.map +0 -1
  200. package/dist/db/schema/account.mjs.map +0 -1
  201. package/dist/db/schema/rate-limit.mjs.map +0 -1
  202. package/dist/db/schema/session.mjs.map +0 -1
  203. package/dist/db/schema/shared.mjs.map +0 -1
  204. package/dist/db/schema/user.mjs.map +0 -1
  205. package/dist/db/schema/verification.mjs.map +0 -1
  206. package/dist/env/color-depth.mjs.map +0 -1
  207. package/dist/env/env-impl.mjs.map +0 -1
  208. package/dist/env/logger.mjs.map +0 -1
  209. package/dist/error/codes.mjs.map +0 -1
  210. package/dist/error/index.mjs.map +0 -1
  211. package/dist/instrumentation/attributes.mjs.map +0 -1
  212. package/dist/instrumentation/tracer.mjs.map +0 -1
  213. package/dist/oauth2/client-credentials-token.mjs.map +0 -1
  214. package/dist/oauth2/create-authorization-url.mjs.map +0 -1
  215. package/dist/oauth2/refresh-access-token.mjs.map +0 -1
  216. package/dist/oauth2/utils.mjs.map +0 -1
  217. package/dist/oauth2/validate-authorization-code.mjs.map +0 -1
  218. package/dist/oauth2/verify.mjs.map +0 -1
  219. package/dist/social-providers/apple.mjs.map +0 -1
  220. package/dist/social-providers/atlassian.mjs.map +0 -1
  221. package/dist/social-providers/cognito.mjs.map +0 -1
  222. package/dist/social-providers/discord.mjs.map +0 -1
  223. package/dist/social-providers/dropbox.mjs.map +0 -1
  224. package/dist/social-providers/facebook.mjs.map +0 -1
  225. package/dist/social-providers/figma.mjs.map +0 -1
  226. package/dist/social-providers/github.mjs.map +0 -1
  227. package/dist/social-providers/gitlab.mjs.map +0 -1
  228. package/dist/social-providers/google.mjs.map +0 -1
  229. package/dist/social-providers/huggingface.mjs.map +0 -1
  230. package/dist/social-providers/index.mjs.map +0 -1
  231. package/dist/social-providers/kakao.mjs.map +0 -1
  232. package/dist/social-providers/kick.mjs.map +0 -1
  233. package/dist/social-providers/line.mjs.map +0 -1
  234. package/dist/social-providers/linear.mjs.map +0 -1
  235. package/dist/social-providers/linkedin.mjs.map +0 -1
  236. package/dist/social-providers/microsoft-entra-id.mjs.map +0 -1
  237. package/dist/social-providers/naver.mjs.map +0 -1
  238. package/dist/social-providers/notion.mjs.map +0 -1
  239. package/dist/social-providers/paybin.mjs.map +0 -1
  240. package/dist/social-providers/paypal.mjs.map +0 -1
  241. package/dist/social-providers/polar.mjs.map +0 -1
  242. package/dist/social-providers/railway.mjs.map +0 -1
  243. package/dist/social-providers/reddit.mjs.map +0 -1
  244. package/dist/social-providers/roblox.mjs.map +0 -1
  245. package/dist/social-providers/salesforce.mjs.map +0 -1
  246. package/dist/social-providers/slack.mjs.map +0 -1
  247. package/dist/social-providers/spotify.mjs.map +0 -1
  248. package/dist/social-providers/tiktok.mjs.map +0 -1
  249. package/dist/social-providers/twitch.mjs.map +0 -1
  250. package/dist/social-providers/twitter.mjs.map +0 -1
  251. package/dist/social-providers/vercel.mjs.map +0 -1
  252. package/dist/social-providers/vk.mjs.map +0 -1
  253. package/dist/social-providers/wechat.mjs.map +0 -1
  254. package/dist/social-providers/zoom.mjs.map +0 -1
  255. package/dist/utils/db.mjs.map +0 -1
  256. package/dist/utils/deprecate.mjs.map +0 -1
  257. package/dist/utils/error-codes.mjs.map +0 -1
  258. package/dist/utils/fetch-metadata.mjs.map +0 -1
  259. package/dist/utils/id.mjs.map +0 -1
  260. package/dist/utils/ip.mjs.map +0 -1
  261. package/dist/utils/json.mjs.map +0 -1
  262. package/dist/utils/string.mjs.map +0 -1
  263. package/dist/utils/url.mjs.map +0 -1
  264. package/src/context/request-state.test.ts +0 -94
  265. package/src/db/adapter/get-id-field.test.ts +0 -222
  266. package/src/db/test/get-tables.test.ts +0 -116
  267. package/src/env/logger.test.ts +0 -34
  268. package/src/instrumentation/instrumentation.test.ts +0 -139
  269. package/src/oauth2/refresh-access-token.test.ts +0 -90
  270. package/src/oauth2/validate-token.test.ts +0 -229
  271. package/src/utils/deprecate.test.ts +0 -71
  272. package/src/utils/fetch-metadata.test.ts +0 -28
  273. package/src/utils/ip.test.ts +0 -255
@@ -71,5 +71,4 @@ declare const polar: (options: PolarOptions) => {
71
71
  options: PolarOptions;
72
72
  };
73
73
  //#endregion
74
- export { PolarOptions, PolarProfile, polar };
75
- //# sourceMappingURL=polar.d.mts.map
74
+ export { PolarOptions, PolarProfile, polar };
@@ -1,7 +1,6 @@
1
1
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
2
2
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
3
3
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { betterFetch } from "@better-fetch/fetch";
6
5
  //#region src/social-providers/polar.ts
7
6
  const polar = (options) => {
@@ -70,5 +69,3 @@ const polar = (options) => {
70
69
  };
71
70
  //#endregion
72
71
  export { polar };
73
-
74
- //# sourceMappingURL=polar.mjs.map
@@ -62,5 +62,4 @@ declare const railway: (options: RailwayOptions) => {
62
62
  options: RailwayOptions;
63
63
  };
64
64
  //#endregion
65
- export { RailwayOptions, RailwayProfile, railway };
66
- //# sourceMappingURL=railway.d.mts.map
65
+ export { RailwayOptions, RailwayProfile, railway };
@@ -1,7 +1,6 @@
1
1
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
2
2
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
3
3
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { betterFetch } from "@better-fetch/fetch";
6
5
  //#region src/social-providers/railway.ts
7
6
  const authorizationEndpoint = "https://backboard.railway.com/oauth/auth";
@@ -73,5 +72,3 @@ const railway = (options) => {
73
72
  };
74
73
  //#endregion
75
74
  export { railway };
76
-
77
- //# sourceMappingURL=railway.mjs.map
@@ -59,5 +59,4 @@ declare const reddit: (options: RedditOptions) => {
59
59
  options: RedditOptions;
60
60
  };
61
61
  //#endregion
62
- export { RedditOptions, RedditProfile, reddit };
63
- //# sourceMappingURL=reddit.d.mts.map
62
+ export { RedditOptions, RedditProfile, reddit };
@@ -1,7 +1,6 @@
1
1
  import { getOAuth2Tokens } from "../oauth2/utils.mjs";
2
2
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
3
3
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { base64 } from "@better-auth/utils/base64";
6
5
  import { betterFetch } from "@better-fetch/fetch";
7
6
  //#region src/social-providers/reddit.ts
@@ -79,5 +78,3 @@ const reddit = (options) => {
79
78
  };
80
79
  //#endregion
81
80
  export { reddit };
82
-
83
- //# sourceMappingURL=reddit.mjs.map
@@ -67,5 +67,4 @@ declare const roblox: (options: RobloxOptions) => {
67
67
  options: RobloxOptions;
68
68
  };
69
69
  //#endregion
70
- export { RobloxOptions, RobloxProfile, roblox };
71
- //# sourceMappingURL=roblox.d.mts.map
70
+ export { RobloxOptions, RobloxProfile, roblox };
@@ -1,6 +1,5 @@
1
1
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
2
2
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
3
- import "../oauth2/index.mjs";
4
3
  import { betterFetch } from "@better-fetch/fetch";
5
4
  //#region src/social-providers/roblox.ts
6
5
  const roblox = (options) => {
@@ -56,5 +55,3 @@ const roblox = (options) => {
56
55
  };
57
56
  //#endregion
58
57
  export { roblox };
59
-
60
- //# sourceMappingURL=roblox.mjs.map
@@ -76,5 +76,4 @@ declare const salesforce: (options: SalesforceOptions) => {
76
76
  options: SalesforceOptions;
77
77
  };
78
78
  //#endregion
79
- export { SalesforceOptions, SalesforceProfile, salesforce };
80
- //# sourceMappingURL=salesforce.d.mts.map
79
+ export { SalesforceOptions, SalesforceProfile, salesforce };
@@ -1,10 +1,8 @@
1
1
  import { logger } from "../env/logger.mjs";
2
- import "../env/index.mjs";
3
2
  import { BetterAuthError } from "../error/index.mjs";
4
3
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
5
4
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
6
5
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
7
- import "../oauth2/index.mjs";
8
6
  import { betterFetch } from "@better-fetch/fetch";
9
7
  //#region src/social-providers/salesforce.ts
10
8
  const salesforce = (options) => {
@@ -87,5 +85,3 @@ const salesforce = (options) => {
87
85
  };
88
86
  //#endregion
89
87
  export { salesforce };
90
-
91
- //# sourceMappingURL=salesforce.mjs.map
@@ -80,5 +80,4 @@ declare const slack: (options: SlackOptions) => {
80
80
  options: SlackOptions;
81
81
  };
82
82
  //#endregion
83
- export { SlackOptions, SlackProfile, slack };
84
- //# sourceMappingURL=slack.d.mts.map
83
+ export { SlackOptions, SlackProfile, slack };
@@ -1,6 +1,5 @@
1
1
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
2
2
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
3
- import "../oauth2/index.mjs";
4
3
  import { betterFetch } from "@better-fetch/fetch";
5
4
  //#region src/social-providers/slack.ts
6
5
  const slack = (options) => {
@@ -65,5 +64,3 @@ const slack = (options) => {
65
64
  };
66
65
  //#endregion
67
66
  export { slack };
68
-
69
- //# sourceMappingURL=slack.mjs.map
@@ -60,5 +60,4 @@ declare const spotify: (options: SpotifyOptions) => {
60
60
  options: SpotifyOptions;
61
61
  };
62
62
  //#endregion
63
- export { SpotifyOptions, SpotifyProfile, spotify };
64
- //# sourceMappingURL=spotify.d.mts.map
63
+ export { SpotifyOptions, SpotifyProfile, spotify };
@@ -1,7 +1,6 @@
1
1
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
2
2
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
3
3
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { betterFetch } from "@better-fetch/fetch";
6
5
  //#region src/social-providers/spotify.ts
7
6
  const spotify = (options) => {
@@ -68,5 +67,3 @@ const spotify = (options) => {
68
67
  };
69
68
  //#endregion
70
69
  export { spotify };
71
-
72
- //# sourceMappingURL=spotify.mjs.map
@@ -165,5 +165,4 @@ declare const tiktok: (options: TiktokOptions) => {
165
165
  options: TiktokOptions;
166
166
  };
167
167
  //#endregion
168
- export { TiktokOptions, TiktokProfile, tiktok };
169
- //# sourceMappingURL=tiktok.d.mts.map
168
+ export { TiktokOptions, TiktokProfile, tiktok };
@@ -1,6 +1,5 @@
1
1
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
2
2
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
3
- import "../oauth2/index.mjs";
4
3
  import { betterFetch } from "@better-fetch/fetch";
5
4
  //#region src/social-providers/tiktok.ts
6
5
  const tiktok = (options) => {
@@ -59,5 +58,3 @@ const tiktok = (options) => {
59
58
  };
60
59
  //#endregion
61
60
  export { tiktok };
62
-
63
- //# sourceMappingURL=tiktok.mjs.map
@@ -76,5 +76,4 @@ declare const twitch: (options: TwitchOptions) => {
76
76
  options: TwitchOptions;
77
77
  };
78
78
  //#endregion
79
- export { TwitchOptions, TwitchProfile, twitch };
80
- //# sourceMappingURL=twitch.d.mts.map
79
+ export { TwitchOptions, TwitchProfile, twitch };
@@ -1,9 +1,7 @@
1
1
  import { logger } from "../env/logger.mjs";
2
- import "../env/index.mjs";
3
2
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
4
3
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
5
4
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
6
- import "../oauth2/index.mjs";
7
5
  import { decodeJwt } from "jose";
8
6
  //#region src/social-providers/twitch.ts
9
7
  const twitch = (options) => {
@@ -75,5 +73,3 @@ const twitch = (options) => {
75
73
  };
76
74
  //#endregion
77
75
  export { twitch };
78
-
79
- //# sourceMappingURL=twitch.mjs.map
@@ -123,5 +123,4 @@ declare const twitter: (options: TwitterOption) => {
123
123
  options: TwitterOption;
124
124
  };
125
125
  //#endregion
126
- export { TwitterOption, TwitterProfile, twitter };
127
- //# sourceMappingURL=twitter.d.mts.map
126
+ export { TwitterOption, TwitterProfile, twitter };
@@ -1,7 +1,6 @@
1
1
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
2
2
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
3
3
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { betterFetch } from "@better-fetch/fetch";
6
5
  //#region src/social-providers/twitter.ts
7
6
  const twitter = (options) => {
@@ -84,5 +83,3 @@ const twitter = (options) => {
84
83
  };
85
84
  //#endregion
86
85
  export { twitter };
87
-
88
- //# sourceMappingURL=twitter.mjs.map
@@ -59,5 +59,4 @@ declare const vercel: (options: VercelOptions) => {
59
59
  options: VercelOptions;
60
60
  };
61
61
  //#endregion
62
- export { VercelOptions, VercelProfile, vercel };
63
- //# sourceMappingURL=vercel.d.mts.map
62
+ export { VercelOptions, VercelProfile, vercel };
@@ -1,7 +1,6 @@
1
1
  import { BetterAuthError } from "../error/index.mjs";
2
2
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
3
3
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { betterFetch } from "@better-fetch/fetch";
6
5
  //#region src/social-providers/vercel.ts
7
6
  const vercel = (options) => {
@@ -57,5 +56,3 @@ const vercel = (options) => {
57
56
  };
58
57
  //#endregion
59
58
  export { vercel };
60
-
61
- //# sourceMappingURL=vercel.mjs.map
@@ -67,5 +67,4 @@ declare const vk: (options: VkOption) => {
67
67
  options: VkOption;
68
68
  };
69
69
  //#endregion
70
- export { VkOption, VkProfile, vk };
71
- //# sourceMappingURL=vk.d.mts.map
70
+ export { VkOption, VkProfile, vk };
@@ -1,7 +1,6 @@
1
1
  import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
2
2
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
3
3
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { betterFetch } from "@better-fetch/fetch";
6
5
  //#region src/social-providers/vk.ts
7
6
  const vk = (options) => {
@@ -80,5 +79,3 @@ const vk = (options) => {
80
79
  };
81
80
  //#endregion
82
81
  export { vk };
83
-
84
- //# sourceMappingURL=vk.mjs.map
@@ -110,5 +110,4 @@ declare const wechat: (options: WeChatOptions) => {
110
110
  options: WeChatOptions;
111
111
  };
112
112
  //#endregion
113
- export { WeChatOptions, WeChatProfile, wechat };
114
- //# sourceMappingURL=wechat.d.mts.map
113
+ export { WeChatOptions, WeChatProfile, wechat };
@@ -79,5 +79,3 @@ const wechat = (options) => {
79
79
  };
80
80
  //#endregion
81
81
  export { wechat };
82
-
83
- //# sourceMappingURL=wechat.mjs.map
@@ -160,5 +160,4 @@ declare const zoom: (userOptions: ZoomOptions) => {
160
160
  } | null>;
161
161
  };
162
162
  //#endregion
163
- export { AccountStatus, LoginType, PhoneNumber, PronounOption, ZoomOptions, ZoomProfile, zoom };
164
- //# sourceMappingURL=zoom.d.mts.map
163
+ export { AccountStatus, LoginType, PhoneNumber, PronounOption, ZoomOptions, ZoomProfile, zoom };
@@ -1,7 +1,6 @@
1
1
  import { generateCodeChallenge } from "../oauth2/utils.mjs";
2
2
  import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
3
3
  import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
4
- import "../oauth2/index.mjs";
5
4
  import { betterFetch } from "@better-fetch/fetch";
6
5
  //#region src/social-providers/zoom.ts
7
6
  const zoom = (userOptions) => {
@@ -68,5 +67,3 @@ const zoom = (userOptions) => {
68
67
  };
69
68
  //#endregion
70
69
  export { zoom };
71
-
72
- //# sourceMappingURL=zoom.mjs.map
@@ -35,6 +35,7 @@ type InferPluginOptions<O extends BetterAuthOptions, ID extends BetterAuthPlugin
35
35
  *
36
36
  * const createMyPlugin = <Options extends MyPluginOptions>(options?: Options) => ({
37
37
  * id: 'my-plugin',
38
+ * version: '1.0.0',
38
39
  * options,
39
40
  * } satisfies BetterAuthPlugin);
40
41
  *
@@ -271,5 +272,4 @@ type AuthContext<Options extends BetterAuthOptions = BetterAuthOptions> = Plugin
271
272
  runInBackgroundOrAwait: (promise: Promise<unknown> | void) => Awaitable<unknown>;
272
273
  };
273
274
  //#endregion
274
- export { AuthContext, BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, InfoContext, InternalAdapter, PluginContext };
275
- //# sourceMappingURL=context.d.mts.map
275
+ export { AuthContext, BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, InfoContext, InternalAdapter, PluginContext };
@@ -12,5 +12,4 @@ type BetterAuthCookies = {
12
12
  dontRememberToken: BetterAuthCookie;
13
13
  };
14
14
  //#endregion
15
- export { BetterAuthCookie, BetterAuthCookies };
16
- //# sourceMappingURL=cookie.d.mts.map
15
+ export { BetterAuthCookie, BetterAuthCookies };
@@ -7,5 +7,4 @@ type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (Base
7
7
  type Prettify<T> = { [K in keyof T]: T[K] } & {};
8
8
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
9
9
  //#endregion
10
- export { Awaitable, AwaitableFunction, LiteralString, LiteralUnion, Prettify, Primitive, UnionToIntersection };
11
- //# sourceMappingURL=helper.d.mts.map
10
+ export { Awaitable, AwaitableFunction, LiteralString, LiteralUnion, Prettify, Primitive, UnionToIntersection };
@@ -165,7 +165,9 @@ type BetterAuthAdvancedOptions = {
165
165
  ipv6Subnet?: 128 | 64 | 48 | 32;
166
166
  } | undefined;
167
167
  /**
168
- * Use secure cookies
168
+ * Force cookies to always use the `Secure` attribute. By default,
169
+ * cookies are secure in production environments. Set this to `true`
170
+ * to enforce secure cookies in all environments.
169
171
  *
170
172
  * @default false
171
173
  */
@@ -314,9 +316,11 @@ type BetterAuthAdvancedOptions = {
314
316
  };
315
317
  type BetterAuthOptions = {
316
318
  /**
317
- * The name of the application
319
+ * The name of your application. Used as a display name in contexts
320
+ * where your app needs to be identified — for example, as the default
321
+ * issuer name in authenticator apps when users set up 2FA/TOTP.
318
322
  *
319
- * process.env.APP_NAME
323
+ * Can also be set via the `APP_NAME` environment variable.
320
324
  *
321
325
  * @default "Better Auth"
322
326
  */
@@ -1010,7 +1014,12 @@ type BetterAuthOptions = {
1010
1014
  storeInDatabase?: boolean;
1011
1015
  }) | undefined;
1012
1016
  /**
1013
- * List of trusted origins.
1017
+ * Additional trusted origins. By default, Better Auth trusts your
1018
+ * app's {@link baseURL}. Use this option to allow additional origins
1019
+ * (e.g. a separate frontend domain).
1020
+ *
1021
+ * Can be a static array, a function that returns origins dynamically,
1022
+ * or use wildcard patterns (e.g. `"https://*.example.com"`).
1014
1023
  *
1015
1024
  * @param request - The request object.
1016
1025
  * It'll be undefined if no request was
@@ -1346,5 +1355,4 @@ type BetterAuthOptions = {
1346
1355
  };
1347
1356
  };
1348
1357
  //#endregion
1349
- export { BaseURLConfig, BetterAuthAdvancedOptions, BetterAuthDBOptions, BetterAuthOptions, BetterAuthRateLimitOptions, BetterAuthRateLimitRule, BetterAuthRateLimitStorage, DynamicBaseURLConfig, GenerateIdFn, StoreIdentifierOption };
1350
- //# sourceMappingURL=init-options.d.mts.map
1358
+ export { BaseURLConfig, BetterAuthAdvancedOptions, BetterAuthDBOptions, BetterAuthOptions, BetterAuthRateLimitOptions, BetterAuthRateLimitRule, BetterAuthRateLimitStorage, DynamicBaseURLConfig, GenerateIdFn, StoreIdentifierOption };
@@ -66,6 +66,7 @@ interface BetterAuthClientOptions {
66
66
  }
67
67
  interface BetterAuthClientPlugin {
68
68
  id: LiteralString;
69
+ version?: string | undefined;
69
70
  /**
70
71
  * only used for type inference. don't pass the
71
72
  * actual plugin
@@ -109,5 +110,4 @@ interface BetterAuthClientPlugin {
109
110
  }>;
110
111
  }
111
112
  //#endregion
112
- export { BetterAuthClientOptions, BetterAuthClientPlugin, ClientAtomListener, ClientFetchOption, ClientStore };
113
- //# sourceMappingURL=plugin-client.d.mts.map
113
+ export { BetterAuthClientOptions, BetterAuthClientPlugin, ClientAtomListener, ClientFetchOption, ClientStore };
@@ -28,6 +28,7 @@ type BetterAuthPluginErrorCodePart = {
28
28
  };
29
29
  type BetterAuthPlugin = BetterAuthPluginErrorCodePart & {
30
30
  id: LiteralString;
31
+ version?: string | undefined;
31
32
  /**
32
33
  * The init function is called when the plugin is initialized.
33
34
  * You can return a new context or modify the existing context.
@@ -123,5 +124,4 @@ type BetterAuthPlugin = BetterAuthPluginErrorCodePart & {
123
124
  };
124
125
  };
125
126
  //#endregion
126
- export { BetterAuthPlugin, BetterAuthPluginErrorCodePart, HookEndpointContext };
127
- //# sourceMappingURL=plugin.d.mts.map
127
+ export { BetterAuthPlugin, BetterAuthPluginErrorCodePart, HookEndpointContext };
@@ -8,5 +8,4 @@ interface SecretConfig {
8
8
  legacySecret?: string;
9
9
  }
10
10
  //#endregion
11
- export { SecretConfig };
12
- //# sourceMappingURL=secret.d.mts.map
11
+ export { SecretConfig };
@@ -6,5 +6,4 @@ import { DBFieldAttribute } from "../db/type.mjs";
6
6
  */
7
7
  declare function filterOutputFields<T extends Record<string, unknown> | null>(data: T, additionalFields: Record<string, DBFieldAttribute> | undefined): T;
8
8
  //#endregion
9
- export { filterOutputFields };
10
- //# sourceMappingURL=db.d.mts.map
9
+ export { filterOutputFields };
package/dist/utils/db.mjs CHANGED
@@ -13,5 +13,3 @@ function filterOutputFields(data, additionalFields) {
13
13
  }
14
14
  //#endregion
15
15
  export { filterOutputFields };
16
-
17
- //# sourceMappingURL=db.mjs.map
@@ -6,5 +6,4 @@ import { InternalLogger } from "../env/logger.mjs";
6
6
  */
7
7
  declare function deprecate<T extends (...args: any[]) => any>(fn: T, message: string, logger?: InternalLogger): T;
8
8
  //#endregion
9
- export { deprecate };
10
- //# sourceMappingURL=deprecate.d.mts.map
9
+ export { deprecate };
@@ -14,5 +14,3 @@ function deprecate(fn, message, logger) {
14
14
  }
15
15
  //#endregion
16
16
  export { deprecate };
17
-
18
- //# sourceMappingURL=deprecate.mjs.map
@@ -10,5 +10,4 @@ type RawError<K extends string = string> = {
10
10
  };
11
11
  declare function defineErrorCodes<const T extends Record<string, string>, R extends { [K in keyof T & string]: RawError<K> }>(codes: ValidateErrorCodes<T>): R;
12
12
  //#endregion
13
- export { RawError, defineErrorCodes };
14
- //# sourceMappingURL=error-codes.d.mts.map
13
+ export { RawError, defineErrorCodes };
@@ -8,5 +8,3 @@ function defineErrorCodes(codes) {
8
8
  }
9
9
  //#endregion
10
10
  export { defineErrorCodes };
11
-
12
- //# sourceMappingURL=error-codes.mjs.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/fetch-metadata.d.ts
2
2
  declare function isBrowserFetchRequest(headers?: Headers | null): boolean;
3
3
  //#endregion
4
- export { isBrowserFetchRequest };
5
- //# sourceMappingURL=fetch-metadata.d.mts.map
4
+ export { isBrowserFetchRequest };
@@ -4,5 +4,3 @@ function isBrowserFetchRequest(headers) {
4
4
  }
5
5
  //#endregion
6
6
  export { isBrowserFetchRequest };
7
-
8
- //# sourceMappingURL=fetch-metadata.mjs.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/id.d.ts
2
2
  declare const generateId: (size?: number) => string;
3
3
  //#endregion
4
- export { generateId };
5
- //# sourceMappingURL=id.d.mts.map
4
+ export { generateId };
package/dist/utils/id.mjs CHANGED
@@ -5,5 +5,3 @@ const generateId = (size) => {
5
5
  };
6
6
  //#endregion
7
7
  export { generateId };
8
-
9
- //# sourceMappingURL=id.mjs.map
@@ -51,5 +51,4 @@ declare function normalizeIP(ip: string, options?: NormalizeIPOptions): string;
51
51
  */
52
52
  declare function createRateLimitKey(ip: string, path: string): string;
53
53
  //#endregion
54
- export { createRateLimitKey, isValidIP, normalizeIP };
55
- //# sourceMappingURL=ip.d.mts.map
54
+ export { createRateLimitKey, isValidIP, normalizeIP };
package/dist/utils/ip.mjs CHANGED
@@ -114,5 +114,3 @@ function createRateLimitKey(ip, path) {
114
114
  }
115
115
  //#endregion
116
116
  export { createRateLimitKey, isValidIP, normalizeIP };
117
-
118
- //# sourceMappingURL=ip.mjs.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/json.d.ts
2
2
  declare function safeJSONParse<T>(data: unknown): T | null;
3
3
  //#endregion
4
- export { safeJSONParse };
5
- //# sourceMappingURL=json.d.mts.map
4
+ export { safeJSONParse };
@@ -1,5 +1,4 @@
1
1
  import { logger } from "../env/logger.mjs";
2
- import "../env/index.mjs";
3
2
  //#region src/utils/json.ts
4
3
  const iso8601Regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
5
4
  function reviveDate(value) {
@@ -40,5 +39,3 @@ function safeJSONParse(data) {
40
39
  }
41
40
  //#endregion
42
41
  export { safeJSONParse };
43
-
44
- //# sourceMappingURL=json.mjs.map
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/string.d.ts
2
2
  declare function capitalizeFirstLetter(str: string): string;
3
3
  //#endregion
4
- export { capitalizeFirstLetter };
5
- //# sourceMappingURL=string.d.mts.map
4
+ export { capitalizeFirstLetter };
@@ -4,5 +4,3 @@ function capitalizeFirstLetter(str) {
4
4
  }
5
5
  //#endregion
6
6
  export { capitalizeFirstLetter };
7
-
8
- //# sourceMappingURL=string.mjs.map
@@ -17,5 +17,4 @@
17
17
  */
18
18
  declare function normalizePathname(requestUrl: string, basePath: string): string;
19
19
  //#endregion
20
- export { normalizePathname };
21
- //# sourceMappingURL=url.d.mts.map
20
+ export { normalizePathname };
@@ -29,5 +29,3 @@ function normalizePathname(requestUrl, basePath) {
29
29
  }
30
30
  //#endregion
31
31
  export { normalizePathname };
32
-
33
- //# sourceMappingURL=url.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/core",
3
- "version": "1.5.7-beta.1",
3
+ "version": "1.6.0-beta.0",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -19,9 +19,11 @@
19
19
  "publishConfig": {
20
20
  "access": "public"
21
21
  },
22
+ "sideEffects": false,
22
23
  "files": [
23
24
  "dist",
24
- "src"
25
+ "src",
26
+ "!src/**/*.test.ts"
25
27
  ],
26
28
  "main": "./dist/index.mjs",
27
29
  "module": "./dist/index.mjs",
@@ -143,12 +145,12 @@
143
145
  "zod": "^4.3.6"
144
146
  },
145
147
  "devDependencies": {
146
- "@better-auth/utils": "0.3.1",
148
+ "@better-auth/utils": "0.4.0",
147
149
  "@better-fetch/fetch": "1.1.21",
148
150
  "@opentelemetry/api": "^1.9.0",
149
151
  "@opentelemetry/sdk-trace-base": "^1.30.0",
150
152
  "@opentelemetry/sdk-trace-node": "^1.30.0",
151
- "better-call": "2.0.2",
153
+ "better-call": "2.0.3",
152
154
  "@cloudflare/workers-types": "^4.20250121.0",
153
155
  "jose": "^6.1.3",
154
156
  "kysely": "^0.28.14",
@@ -156,10 +158,10 @@
156
158
  "tsdown": "0.21.1"
157
159
  },
158
160
  "peerDependencies": {
159
- "@better-auth/utils": "0.3.1",
161
+ "@better-auth/utils": "0.4.0",
160
162
  "@better-fetch/fetch": "1.1.21",
161
163
  "@opentelemetry/api": "^1.9.0",
162
- "better-call": "2.0.2",
164
+ "better-call": "2.0.3",
163
165
  "@cloudflare/workers-types": ">=4",
164
166
  "jose": "^6.1.0",
165
167
  "kysely": "^0.28.5",
@@ -173,7 +175,7 @@
173
175
  "scripts": {
174
176
  "build": "tsdown",
175
177
  "dev": "tsdown --watch",
176
- "lint:package": "publint run --strict",
178
+ "lint:package": "publint run --strict --pack false",
177
179
  "lint:types": "attw --profile esm-only --pack .",
178
180
  "typecheck": "tsc --project tsconfig.json",
179
181
  "test": "vitest",