@better-auth/infra 0.4.0 → 0.4.2

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/dist/native.d.mts CHANGED
@@ -1,6 +1,5 @@
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-RI-JiXQx.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-CgijjwVT.mjs";
2
2
  import { BetterAuthClientPlugin } from "better-auth";
3
-
4
3
  //#region src/sentinel/native/client.d.ts
5
4
  interface SentinelNativeClientOptions {
6
5
  identifyUrl?: string;
package/dist/native.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { o as createKV, t as bytesToHex } from "./crypto-CAdWFWEz.mjs";
2
- import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, t as createPowRetryTimeout } from "./pow-retry-DZhZiYd_.mjs";
1
+ import { o as createKV, t as bytesToHex } from "./crypto-D3yZH0Cy.mjs";
2
+ import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, t as createPowRetryTimeout } from "./pow-retry-jWGI__oh.mjs";
3
3
  import { env } from "@better-auth/core/env";
4
4
  import { Dimensions, InteractionManager, PixelRatio, Platform } from "react-native";
5
5
  //#region src/sentinel/native/components.ts
@@ -224,12 +224,13 @@ function scheduleIdentify(send) {
224
224
  }
225
225
  const sentinelNativeClient = (options) => {
226
226
  const autoSolve = options?.autoSolveChallenge !== false;
227
+ const identifyUrl = resolveSentinelClientIdentifyUrl({
228
+ identifyUrl: options?.identifyUrl,
229
+ envKvUrl: env.BETTER_AUTH_KV_URL
230
+ });
227
231
  const runtime = createNativeFingerprintRuntime({
228
232
  $kv: createKV({
229
- kvUrl: resolveSentinelClientIdentifyUrl({
230
- identifyUrl: options?.identifyUrl,
231
- envKvUrl: env.BETTER_AUTH_KV_URL
232
- }),
233
+ kvUrl: identifyUrl,
233
234
  timeout: options?.identifyOptions?.timeout ?? options?.kvTimeout
234
235
  }, {
235
236
  throw: true,
@@ -1,4 +1,4 @@
1
- import { i as randomBytes, n as hash, t as bytesToHex } from "./crypto-CAdWFWEz.mjs";
1
+ import { i as randomBytes, n as hash, t as bytesToHex } from "./crypto-D3yZH0Cy.mjs";
2
2
  //#region src/dash-client.ts
3
3
  function resolveDashUserId(input, options) {
4
4
  return input.userId || options?.resolveUserId?.({
@@ -120,7 +120,8 @@ async function solvePoWChallenge(challenge) {
120
120
  const { nonce, difficulty } = challenge;
121
121
  let counter = 0;
122
122
  while (true) {
123
- if (hasLeadingZeroBits(await hash(`${nonce}:${counter}`), difficulty)) return {
123
+ const input = `${nonce}:${counter}`;
124
+ if (hasLeadingZeroBits(await hash(input), difficulty)) return {
124
125
  nonce,
125
126
  counter
126
127
  };
@@ -1,7 +1,6 @@
1
1
  import { BetterAuthPlugin, GenericEndpointContext } from "better-auth";
2
2
  import { createFetch } from "@better-fetch/fetch";
3
3
  import { APIError as APIError$1, Endpoint, EndpointOptions } from "better-call";
4
-
5
4
  //#region src/identification.d.ts
6
5
  interface IPLocation {
7
6
  lat: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/infra",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Dashboard and analytics plugin for Better Auth",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -70,19 +70,21 @@
70
70
  "@types/bun": "latest",
71
71
  "@types/node": "^24.12.0",
72
72
  "better-auth": "1.7.0-rc.1",
73
- "expo-crypto": "^14.0.2",
73
+ "expo-crypto": "^57.0.1",
74
74
  "happy-dom": "^20.9.0",
75
75
  "msw": "^2.14.6",
76
- "tsdown": "^0.22.0",
76
+ "tsdown": "^0.22.14",
77
77
  "typescript": "^5.9.2",
78
78
  "zod": "4.3.6"
79
79
  },
80
80
  "dependencies": {
81
81
  "@better-auth/utils": "^0.4.2",
82
82
  "@better-fetch/fetch": "1.3.1",
83
+ "@noble/hashes": "^2.2.0",
84
+ "@xmldom/xmldom": "^0.9.10",
83
85
  "better-call": "1.3.7",
84
86
  "jose": "^6.2.4",
85
- "libphonenumber-js": "^1.13.9"
87
+ "libphonenumber-js": "^1.13.11"
86
88
  },
87
89
  "peerDependencies": {
88
90
  "better-auth": ">=1.4.0",
@@ -1,12 +0,0 @@
1
- //#region src/directory-sync/saml-policy.ts
2
- /**
3
- * `deriveSAMLServiceProviderPolicy` ships in `@better-auth/sso` 1.7.0-rc.4+.
4
- * Load it at runtime so catalog typecheck against rc.1 still succeeds.
5
- */
6
- async function requiresSignedSAMLAssertions(config) {
7
- const sso = await import("@better-auth/sso");
8
- if (typeof sso.deriveSAMLServiceProviderPolicy === "function") return sso.deriveSAMLServiceProviderPolicy(config).wantAssertionsSigned;
9
- return config.wantAssertionsSigned === true;
10
- }
11
- //#endregion
12
- export { requiresSignedSAMLAssertions };