@clerk/backend 3.0.0-snapshot.v20260114124449 → 3.0.0-snapshot.v20260114212940

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.
@@ -3,16 +3,6 @@ export declare const API_VERSION = "v1";
3
3
  export declare const USER_AGENT: string;
4
4
  export declare const MAX_CACHE_LAST_UPDATED_AT_SECONDS: number;
5
5
  export declare const SUPPORTED_BAPI_VERSION = "2025-11-10";
6
- /**
7
- * Sync status values for the __clerk_sync query parameter.
8
- * Used to coordinate satellite domain authentication flows.
9
- */
10
- export declare const ClerkSyncStatus: {
11
- /** Trigger sync - satellite needs to handshake after returning from primary sign-in */
12
- readonly NeedsSync: "1";
13
- /** Sync completed - prevents re-sync loop after handshake completes */
14
- readonly Completed: "2";
15
- };
16
6
  /**
17
7
  * @internal
18
8
  */
@@ -68,9 +58,7 @@ export declare const constants: {
68
58
  readonly Json: "application/json";
69
59
  };
70
60
  readonly QueryParameters: {
71
- /** @deprecated Use ClerkSync with ClerkSyncStatus instead */
72
61
  readonly ClerkSynced: "__clerk_synced";
73
- readonly ClerkSync: "__clerk_sync";
74
62
  readonly SuffixedCookies: "suffixed_cookies";
75
63
  readonly ClerkRedirectUrl: "__clerk_redirect_url";
76
64
  readonly DevBrowser: "__clerk_db_jwt";
@@ -82,12 +70,6 @@ export declare const constants: {
82
70
  readonly HandshakeFormat: "format";
83
71
  readonly Session: "__session";
84
72
  };
85
- readonly ClerkSyncStatus: {
86
- /** Trigger sync - satellite needs to handshake after returning from primary sign-in */
87
- readonly NeedsSync: "1";
88
- /** Sync completed - prevents re-sync loop after handshake completes */
89
- readonly Completed: "2";
90
- };
91
73
  };
92
74
  export type Constants = typeof constants;
93
75
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAC/C,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,eAAO,MAAM,UAAU,QAAuC,CAAC;AAC/D,eAAO,MAAM,iCAAiC,QAAS,CAAC;AACxD,eAAO,MAAM,sBAAsB,eAAe,CAAC;AAyEnD;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,uFAAuF;;IAEvF,uEAAuE;;CAE/D,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAjEpB,6DAA6D;;;;;;;;;;;;;;;QAwD7D,uFAAuF;;QAEvF,uEAAuE;;;CAc/D,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAC/C,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,eAAO,MAAM,UAAU,QAAuC,CAAC;AAC/D,eAAO,MAAM,iCAAiC,QAAS,CAAC;AACxD,eAAO,MAAM,sBAAsB,eAAe,CAAC;AAuEnD;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMZ,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC"}
@@ -15,7 +15,6 @@ type CreateRedirect = <ReturnType>(params: {
15
15
  signInUrl?: URL | string;
16
16
  signUpUrl?: URL | string;
17
17
  sessionStatus?: SessionStatusClaim | null;
18
- isSatellite?: boolean;
19
18
  }) => {
20
19
  redirectToSignIn: RedirectFun<ReturnType>;
21
20
  redirectToSignUp: RedirectFun<ReturnType>;
@@ -1 +1 @@
1
- {"version":3,"file":"createRedirect.d.ts","sourceRoot":"","sources":["../src/createRedirect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kB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AU,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,KAAK,UAAU,CAAC;AAEhF;;GAEG;AACH,KAAK,cAAc,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IAC7C,OAAO,EAAE,GAAG,GAAG,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC3C,KAAK;IACJ,gBAAgB,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,gBAAgB,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAwD5B,CAAC"}
package/dist/index.js CHANGED
@@ -1870,7 +1870,7 @@ var snakecase_keys_default = snakecaseKeys;
1870
1870
  // src/constants.ts
1871
1871
  var API_URL = "https://api.clerk.com";
1872
1872
  var API_VERSION = "v1";
1873
- var USER_AGENT = `${"@clerk/backend"}@${"3.0.0-snapshot.v20260114124449"}`;
1873
+ var USER_AGENT = `${"@clerk/backend"}@${"3.0.0-snapshot.v20260114212940"}`;
1874
1874
  var MAX_CACHE_LAST_UPDATED_AT_SECONDS = 5 * 60;
1875
1875
  var SUPPORTED_BAPI_VERSION = "2025-11-10";
1876
1876
  var Attributes = {
@@ -1891,9 +1891,7 @@ var Cookies = {
1891
1891
  HandshakeNonce: "__clerk_handshake_nonce"
1892
1892
  };
1893
1893
  var QueryParameters = {
1894
- /** @deprecated Use ClerkSync with ClerkSyncStatus instead */
1895
1894
  ClerkSynced: "__clerk_synced",
1896
- ClerkSync: "__clerk_sync",
1897
1895
  SuffixedCookies: "suffixed_cookies",
1898
1896
  ClerkRedirectUrl: "__clerk_redirect_url",
1899
1897
  // use the reference to Cookies to indicate that it's the same value
@@ -1939,19 +1937,12 @@ var Headers2 = {
1939
1937
  var ContentTypes = {
1940
1938
  Json: "application/json"
1941
1939
  };
1942
- var ClerkSyncStatus = {
1943
- /** Trigger sync - satellite needs to handshake after returning from primary sign-in */
1944
- NeedsSync: "1",
1945
- /** Sync completed - prevents re-sync loop after handshake completes */
1946
- Completed: "2"
1947
- };
1948
1940
  var constants = {
1949
1941
  Attributes,
1950
1942
  Cookies,
1951
1943
  Headers: Headers2,
1952
1944
  ContentTypes,
1953
- QueryParameters,
1954
- ClerkSyncStatus
1945
+ QueryParameters
1955
1946
  };
1956
1947
 
1957
1948
  // src/util/optionsAssertions.ts
@@ -5879,46 +5870,17 @@ var authenticateRequest = (async (request, options) => {
5879
5870
  }
5880
5871
  }
5881
5872
  const isRequestEligibleForMultiDomainSync = authenticateContext.isSatellite && authenticateContext.secFetchDest === "document";
5882
- const syncStatus = authenticateContext.clerkUrl.searchParams.get(constants.QueryParameters.ClerkSync);
5883
- const needsSync = syncStatus === constants.ClerkSyncStatus.NeedsSync;
5884
- const legacySynced = authenticateContext.clerkUrl.searchParams.get(constants.QueryParameters.ClerkSynced) === "true";
5885
- const syncCompleted = syncStatus === constants.ClerkSyncStatus.Completed || legacySynced;
5886
- const hasCookies = hasSessionToken || hasActiveClient;
5887
- const shouldSkipSatelliteHandshake = authenticateContext.satelliteAutoSync === false && !hasCookies && !needsSync;
5888
- if (authenticateContext.instanceType === "production" && isRequestEligibleForMultiDomainSync && !syncCompleted) {
5889
- if (shouldSkipSatelliteHandshake) {
5890
- return signedOut({
5891
- tokenType: TokenType.SessionToken,
5892
- authenticateContext,
5893
- reason: AuthErrorReason.SessionTokenAndUATMissing
5894
- });
5895
- }
5896
- if (!hasCookies || needsSync) {
5897
- return handleMaybeHandshakeStatus(authenticateContext, AuthErrorReason.SatelliteCookieNeedsSyncing, "");
5898
- }
5899
- }
5900
- if (authenticateContext.instanceType === "development" && isRequestEligibleForMultiDomainSync && !syncCompleted) {
5901
- if (shouldSkipSatelliteHandshake) {
5902
- return signedOut({
5903
- tokenType: TokenType.SessionToken,
5904
- authenticateContext,
5905
- reason: AuthErrorReason.SessionTokenAndUATMissing
5906
- });
5907
- }
5908
- if (!hasCookies || needsSync) {
5909
- const redirectURL = new URL(authenticateContext.signInUrl);
5910
- redirectURL.searchParams.append(
5911
- constants.QueryParameters.ClerkRedirectUrl,
5912
- authenticateContext.clerkUrl.toString()
5913
- );
5914
- const headers = new Headers({ [constants.Headers.Location]: redirectURL.toString() });
5915
- return handleMaybeHandshakeStatus(
5916
- authenticateContext,
5917
- AuthErrorReason.SatelliteCookieNeedsSyncing,
5918
- "",
5919
- headers
5920
- );
5921
- }
5873
+ if (authenticateContext.instanceType === "production" && isRequestEligibleForMultiDomainSync) {
5874
+ return handleMaybeHandshakeStatus(authenticateContext, AuthErrorReason.SatelliteCookieNeedsSyncing, "");
5875
+ }
5876
+ if (authenticateContext.instanceType === "development" && isRequestEligibleForMultiDomainSync && !authenticateContext.clerkUrl.searchParams.has(constants.QueryParameters.ClerkSynced)) {
5877
+ const redirectURL = new URL(authenticateContext.signInUrl);
5878
+ redirectURL.searchParams.append(
5879
+ constants.QueryParameters.ClerkRedirectUrl,
5880
+ authenticateContext.clerkUrl.toString()
5881
+ );
5882
+ const headers = new Headers({ [constants.Headers.Location]: redirectURL.toString() });
5883
+ return handleMaybeHandshakeStatus(authenticateContext, AuthErrorReason.SatelliteCookieNeedsSyncing, "", headers);
5922
5884
  }
5923
5885
  const redirectUrl = new URL(authenticateContext.clerkUrl).searchParams.get(
5924
5886
  constants.QueryParameters.ClerkRedirectUrl
@@ -5931,10 +5893,7 @@ var authenticateRequest = (async (request, options) => {
5931
5893
  authenticateContext.devBrowserToken
5932
5894
  );
5933
5895
  }
5934
- redirectBackToSatelliteUrl.searchParams.set(
5935
- constants.QueryParameters.ClerkSync,
5936
- constants.ClerkSyncStatus.Completed
5937
- );
5896
+ redirectBackToSatelliteUrl.searchParams.append(constants.QueryParameters.ClerkSynced, "true");
5938
5897
  const headers = new Headers({ [constants.Headers.Location]: redirectBackToSatelliteUrl.toString() });
5939
5898
  return handleMaybeHandshakeStatus(authenticateContext, AuthErrorReason.PrimaryRespondsToSyncing, "", headers);
5940
5899
  }