@better-auth/core 1.6.17 → 1.6.18

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.
@@ -2,7 +2,7 @@
2
2
  const symbol = Symbol.for("better-auth:global");
3
3
  let bind = null;
4
4
  const __context = {};
5
- const __betterAuthVersion = "1.6.17";
5
+ const __betterAuthVersion = "1.6.18";
6
6
  /**
7
7
  * We store context instance in the globalThis.
8
8
  *
@@ -2,7 +2,7 @@ import { ATTR_HTTP_RESPONSE_STATUS_CODE } from "./attributes.mjs";
2
2
  import { getOpenTelemetryAPI } from "./api.mjs";
3
3
  //#region src/instrumentation/tracer.ts
4
4
  const INSTRUMENTATION_SCOPE = "better-auth";
5
- const INSTRUMENTATION_VERSION = "1.6.17";
5
+ const INSTRUMENTATION_VERSION = "1.6.18";
6
6
  /**
7
7
  * Better-auth uses `throw ctx.redirect(url)` for flow control (e.g. OAuth
8
8
  * callbacks). These are APIErrors with 3xx status codes and should not be
@@ -1,10 +1,20 @@
1
1
  import { LiteralString } from "./helper.mjs";
2
- import { BetterAuthPlugin } from "./plugin.mjs";
3
2
  import { BetterAuthOptions } from "./init-options.mjs";
4
3
  import { BetterFetch, BetterFetchOption, BetterFetchPlugin } from "@better-fetch/fetch";
5
4
  import { Atom, WritableAtom } from "nanostores";
6
5
 
7
6
  //#region src/types/plugin-client.d.ts
7
+ type InferableServerPlugin = {
8
+ id?: LiteralString | undefined;
9
+ endpoints?: Record<string, unknown> | undefined;
10
+ schema?: Record<string, {
11
+ fields: Record<string, unknown>;
12
+ }> | undefined;
13
+ $ERROR_CODES?: Record<string, {
14
+ readonly code: string;
15
+ message: string;
16
+ }> | undefined;
17
+ };
8
18
  interface ClientStore {
9
19
  notify: (signal: string) => void;
10
20
  listen: (signal: string, listener: () => void) => void;
@@ -71,7 +81,7 @@ interface BetterAuthClientPlugin {
71
81
  * only used for type inference. don't pass the
72
82
  * actual plugin
73
83
  */
74
- $InferServerPlugin?: BetterAuthPlugin | undefined;
84
+ $InferServerPlugin?: InferableServerPlugin | undefined;
75
85
  /**
76
86
  * Custom actions
77
87
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/core",
3
- "version": "1.6.17",
3
+ "version": "1.6.18",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -6,7 +6,21 @@ import type {
6
6
  import type { Atom, WritableAtom } from "nanostores";
7
7
  import type { LiteralString } from "./helper";
8
8
  import type { BetterAuthOptions } from "./init-options";
9
- import type { BetterAuthPlugin } from "./plugin";
9
+
10
+ type InferableServerPlugin = {
11
+ id?: LiteralString | undefined;
12
+ endpoints?: Record<string, unknown> | undefined;
13
+ schema?: Record<string, { fields: Record<string, unknown> }> | undefined;
14
+ $ERROR_CODES?:
15
+ | Record<
16
+ string,
17
+ {
18
+ readonly code: string;
19
+ message: string;
20
+ }
21
+ >
22
+ | undefined;
23
+ };
10
24
 
11
25
  export interface ClientStore {
12
26
  notify: (signal: string) => void;
@@ -84,7 +98,7 @@ export interface BetterAuthClientPlugin {
84
98
  * only used for type inference. don't pass the
85
99
  * actual plugin
86
100
  */
87
- $InferServerPlugin?: BetterAuthPlugin | undefined;
101
+ $InferServerPlugin?: InferableServerPlugin | undefined;
88
102
  /**
89
103
  * Custom actions
90
104
  */