@better-auth/infra 0.4.7 → 0.4.9

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 CHANGED
@@ -5,6 +5,18 @@ All notable changes to `@better-auth/infra` are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0/).
7
7
 
8
+ ## [0.4.9] - 2026-09-09
9
+
10
+ ### Fixed
11
+
12
+ - **Auth base URL resolution** — Correctly handle Better Auth `baseURL` with an embedded path and dynamic `allowedHosts` (1.5+): dash config, invitation callbacks, SSO/SCIM endpoints, and Sentinel no longer use the wrong mount path or break on object `baseURL`.
13
+
14
+ ## [0.4.8] - 2026-09-09
15
+
16
+ ### Added
17
+
18
+ - **`apiOptions.headers` / `kvOptions.headers`** — Extra headers on dash, sentinel, email, and SMS HTTP clients. Built-in auth headers cannot be overridden.
19
+
8
20
  ## [0.4.7] - 2026-09-07
9
21
 
10
22
  ### Fixed
package/dist/client.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as DashGetAllAuditLogsInput, i as DashClientOptions, n as DashAuditLog, o as DashGetAuditLogsInput, r as DashAuditLogsResponse, s as dashClient, t as IdentifyClientOptions } from "./identify-client-options-Be9mAljS.mjs";
1
+ import { a as DashGetAllAuditLogsInput, i as DashClientOptions, n as DashAuditLog, o as DashGetAuditLogsInput, r as DashAuditLogsResponse, s as dashClient, t as IdentifyClientOptions } from "./identify-client-options-DgKA4Eq8.mjs";
2
2
  import { BetterFetchPlugin } from "@better-fetch/fetch";
3
3
  //#region src/sentinel/client.d.ts
4
4
  interface SentinelClientOptions {
package/dist/client.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as hash, o as createKV } from "./crypto-C9Iqqv8l.mjs";
2
- import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, s as generateRequestId, t as createPowRetryTimeout } from "./pow-retry-Bk5otjQT.mjs";
1
+ import { n as hash, o as createKV } from "./crypto-DDadesq-.mjs";
2
+ import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, s as generateRequestId, t as createPowRetryTimeout } from "./pow-retry-DRUkPcBn.mjs";
3
3
  import { env } from "@better-auth/core/env";
4
4
  //#region src/sentinel/fingerprint.ts
5
5
  function murmurhash3(str, seed = 0) {
@@ -1,7 +1,7 @@
1
1
  import { env } from "@better-auth/core/env";
2
2
  //#endregion
3
3
  //#region src/version.ts
4
- const PLUGIN_VERSION = "0.4.7";
4
+ const PLUGIN_VERSION = "0.4.9";
5
5
  //#endregion
6
6
  //#region src/constants.ts
7
7
  /**
@@ -1,26 +1,29 @@
1
- import { i as INFRA_USER_AGENT } from "./constants-BypXAAvQ.mjs";
1
+ import { i as INFRA_USER_AGENT } from "./constants-CdZodAXp.mjs";
2
2
  import { createFetch } from "@better-fetch/fetch";
3
3
  import { sha256 } from "@noble/hashes/sha2.js";
4
4
  //#region src/fetch.ts
5
5
  function createAPI(options, fetchOptions) {
6
6
  return createFetch({
7
7
  baseURL: options.apiUrl,
8
+ timeout: options.apiOptions.timeout,
9
+ ...fetchOptions,
8
10
  headers: {
11
+ ...options.apiOptions.headers,
9
12
  "user-agent": INFRA_USER_AGENT,
10
13
  "x-api-key": options.apiKey
11
- },
12
- timeout: options.apiOptions.timeout,
13
- ...fetchOptions
14
+ }
14
15
  });
15
16
  }
16
17
  function createKV(options, fetchOptions) {
17
- const headers = { "user-agent": INFRA_USER_AGENT };
18
- if (options.apiKey) headers["x-api-key"] = options.apiKey;
19
18
  return createFetch({
20
19
  baseURL: options.kvUrl,
21
- headers,
22
20
  timeout: options.timeout ?? 1e3,
23
- ...fetchOptions
21
+ ...fetchOptions,
22
+ headers: {
23
+ ...options.headers,
24
+ "user-agent": INFRA_USER_AGENT,
25
+ ...options.apiKey ? { "x-api-key": options.apiKey } : {}
26
+ }
24
27
  });
25
28
  }
26
29
  //#endregion
package/dist/email.d.mts CHANGED
@@ -155,6 +155,11 @@ interface EmailConfig {
155
155
  * @default 3000
156
156
  */
157
157
  timeout?: number;
158
+ /**
159
+ * Extra headers on every email API request.
160
+ * Cannot override built-in headers (`user-agent`, `Authorization`).
161
+ */
162
+ headers?: Record<string, string>;
158
163
  };
159
164
  /**
160
165
  * Timeout for Dash email API HTTP requests (milliseconds).
package/dist/email.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as INFRA_USER_AGENT, n as INFRA_API_URL } from "./constants-BypXAAvQ.mjs";
1
+ import { i as INFRA_USER_AGENT, n as INFRA_API_URL } from "./constants-CdZodAXp.mjs";
2
2
  import { logger } from "better-auth";
3
3
  import { env } from "@better-auth/core/env";
4
4
  import { createFetch } from "@better-fetch/fetch";
@@ -37,11 +37,12 @@ function createEmailSender(config) {
37
37
  if (!apiKey) logger.warn("[Dash] No API key provided for email sending. Set BETTER_AUTH_API_KEY environment variable or pass apiKey in config.");
38
38
  const $api = createFetch({
39
39
  baseURL: apiUrl,
40
+ timeout: config?.apiOptions?.timeout ?? config?.apiTimeout ?? 3e3,
40
41
  headers: {
42
+ ...config?.apiOptions?.headers,
41
43
  "user-agent": INFRA_USER_AGENT,
42
44
  Authorization: `Bearer ${apiKey}`
43
- },
44
- timeout: config?.apiOptions?.timeout ?? config?.apiTimeout ?? 3e3
45
+ }
45
46
  });
46
47
  /**
47
48
  * Send an email using a template from Better Auth Infra
@@ -1,4 +1,4 @@
1
- import { m as KvRetryOptions } from "./types-Ba7NK8JV.mjs";
1
+ import { g as KvRetryOptions } from "./types-BkUWsMpe.mjs";
2
2
  import { BetterAuthClientOptions, ClientStore } from "better-auth";
3
3
  import { BetterFetch } from "@better-fetch/fetch";
4
4
  //#region src/dash-client.d.ts