@clerk/backend 3.4.2-snapshot.v20260429150611 → 3.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/index.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  createAuthenticateRequest,
3
3
  createBackendApiClient,
4
4
  verifyToken
5
- } from "./chunk-TYMAXIGL.mjs";
5
+ } from "./chunk-EFHKSFRG.mjs";
6
6
  import "./chunk-YBVFDYDR.mjs";
7
7
  import {
8
8
  withLegacyReturn
package/dist/internal.js CHANGED
@@ -230,7 +230,7 @@ module.exports = __toCommonJS(internal_exports);
230
230
  // src/constants.ts
231
231
  var API_URL = "https://api.clerk.com";
232
232
  var API_VERSION = "v1";
233
- var USER_AGENT = `${"@clerk/backend"}@${"3.4.2-snapshot.v20260429150611"}`;
233
+ var USER_AGENT = `${"@clerk/backend"}@${"3.4.2"}`;
234
234
  var MAX_CACHE_LAST_UPDATED_AT_SECONDS = 5 * 60;
235
235
  var SUPPORTED_BAPI_VERSION = "2025-11-10";
236
236
  var Attributes = {
@@ -887,6 +887,7 @@ function assertValidPublishableKey(val) {
887
887
 
888
888
  // src/tokens/authenticateContext.ts
889
889
  var import_buildAccountsBaseUrl2 = require("@clerk/shared/buildAccountsBaseUrl");
890
+ var import_proxy = require("@clerk/shared/proxy");
890
891
  var import_url2 = require("@clerk/shared/url");
891
892
 
892
893
  // src/tokens/tokenTypes.ts
@@ -907,6 +908,14 @@ var AuthenticateContext = class {
907
908
  * Used for backend operations like token validation and issuer checking.
908
909
  */
909
910
  this.originalFrontendApi = "";
911
+ const autoProxyPath = (0, import_proxy.getAutoProxyUrlFromEnvironment)({
912
+ publishableKey: options.publishableKey ?? "",
913
+ hasProxyUrl: !!options.proxyUrl,
914
+ hasDomain: !!options.domain
915
+ });
916
+ if (autoProxyPath) {
917
+ options = { ...options, proxyUrl: `${clerkRequest.clerkUrl.origin}${autoProxyPath}` };
918
+ }
910
919
  if (options.acceptsToken === TokenType.M2MToken || options.acceptsToken === TokenType.ApiKey) {
911
920
  this.initHeaderValues();
912
921
  } else {
@@ -5623,7 +5632,20 @@ var createClerkUrl = (...args) => {
5623
5632
  var ClerkRequest = class extends Request {
5624
5633
  constructor(input, init) {
5625
5634
  const url = typeof input !== "string" && "url" in input ? input.url : String(input);
5626
- super(url, init || typeof input === "string" ? void 0 : input);
5635
+ let cloneInit;
5636
+ if (init) {
5637
+ cloneInit = init;
5638
+ } else if (typeof input !== "string") {
5639
+ cloneInit = new Proxy(input, {
5640
+ get(target, prop) {
5641
+ if (prop === "signal") {
5642
+ return void 0;
5643
+ }
5644
+ return Reflect.get(target, prop, target);
5645
+ }
5646
+ });
5647
+ }
5648
+ super(url, cloneInit);
5627
5649
  this.clerkUrl = this.deriveUrlFromHeaders(this);
5628
5650
  this.cookies = this.parseCookies(this);
5629
5651
  }