@clerk/tanstack-react-start 1.4.1 → 1.4.2-canary.v20260610190754
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/ClerkProvider-BgJPTole.d.ts +14 -0
- package/dist/client/ClerkProvider.d.ts +2 -12
- package/dist/client/ClerkProvider.js +58 -68
- package/dist/client/ClerkProvider.js.map +1 -1
- package/dist/client/OptionsContext.d.ts +7 -9
- package/dist/client/OptionsContext.js +13 -11
- package/dist/client/OptionsContext.js.map +1 -1
- package/dist/client/index.d.ts +3 -10
- package/dist/client/index.js +4 -5
- package/dist/client/types.d.ts +2 -34
- package/dist/client/types.js +1 -3
- package/dist/client/uiComponents.d.ts +2 -11
- package/dist/client/uiComponents.js +25 -44
- package/dist/client/uiComponents.js.map +1 -1
- package/dist/client/useAwaitableNavigate.d.ts +4 -2
- package/dist/client/useAwaitableNavigate.js +24 -24
- package/dist/client/useAwaitableNavigate.js.map +1 -1
- package/dist/client/utils.d.ts +12 -13
- package/dist/client/utils.js +59 -76
- package/dist/client/utils.js.map +1 -1
- package/dist/errors.d.ts +2 -4
- package/dist/errors.js +3 -3
- package/dist/experimental.d.ts +1 -1
- package/dist/experimental.js +3 -3
- package/dist/global.d.ts +1 -0
- package/dist/index.d.ts +5 -10
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -1
- package/dist/legacy.js +3 -3
- package/dist/server/auth.d.ts +5 -3
- package/dist/server/auth.js +13 -13
- package/dist/server/auth.js.map +1 -1
- package/dist/server/clerkClient.d.ts +4 -2
- package/dist/server/clerkClient.js +23 -23
- package/dist/server/clerkClient.js.map +1 -1
- package/dist/server/clerkMiddleware.d.ts +5 -6
- package/dist/server/clerkMiddleware.js +54 -68
- package/dist/server/clerkMiddleware.js.map +1 -1
- package/dist/server/constants.d.ts +27 -25
- package/dist/server/constants.js +33 -35
- package/dist/server/constants.js.map +1 -1
- package/dist/server/index.d.ts +6 -8
- package/dist/server/index.js +5 -5
- package/dist/server/keyless/fileStorage.d.ts +6 -5
- package/dist/server/keyless/fileStorage.js +10 -10
- package/dist/server/keyless/fileStorage.js.map +1 -1
- package/dist/server/keyless/index.d.ts +4 -4
- package/dist/server/keyless/index.js +33 -35
- package/dist/server/keyless/index.js.map +1 -1
- package/dist/server/keyless/utils.d.ts +6 -5
- package/dist/server/keyless/utils.js +13 -6
- package/dist/server/keyless/utils.js.map +1 -1
- package/dist/server/loadOptions.d.ts +59 -60
- package/dist/server/loadOptions.js +42 -52
- package/dist/server/loadOptions.js.map +1 -1
- package/dist/server/types.d.ts +29 -27
- package/dist/server/types.js +1 -3
- package/dist/server/utils/index.d.ts +7 -7
- package/dist/server/utils/index.js +62 -50
- package/dist/server/utils/index.js.map +1 -1
- package/dist/types/index.d.ts +4 -8
- package/dist/types/index.js +1 -3
- package/dist/types-DePBcrHU.d.ts +36 -0
- package/dist/uiComponents-Cle0hs-_.d.ts +12 -0
- package/dist/utils/env.d.ts +20 -18
- package/dist/utils/env.js +27 -29
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/errors.d.ts +3 -1
- package/dist/utils/errors.js +6 -6
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/feature-flags.d.ts +3 -1
- package/dist/utils/feature-flags.js +16 -7
- package/dist/utils/feature-flags.js.map +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/index.js +6 -8
- package/dist/utils/index.js.map +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/dist/webhooks.js +3 -3
- package/package.json +6 -6
- package/dist/client/index.js.map +0 -1
- package/dist/client/types.js.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/experimental.js.map +0 -1
- package/dist/global.d.d.ts +0 -2
- package/dist/global.d.js +0 -3
- package/dist/global.d.js.map +0 -1
- package/dist/legacy.js.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/types.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/webhooks.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"loadOptions.js","names":[],"sources":["../../src/server/loadOptions.ts"],"sourcesContent":["import type { ClerkRequest } from '@clerk/backend/internal';\nimport { apiUrlFromPublishableKey } from '@clerk/shared/apiUrlFromPublishableKey';\nimport { getEnvVariable } from '@clerk/shared/getEnvVariable';\nimport { isDevelopmentFromSecretKey } from '@clerk/shared/keys';\nimport { isHttpOrHttps, isProxyUrlRelative } from '@clerk/shared/proxy';\n\nimport { errorThrower } from '../utils';\nimport { canUseKeyless } from '../utils/feature-flags';\nimport { commonEnvs } from './constants';\nimport type { LoaderOptions } from './types';\n\nexport const loadOptions = (request: ClerkRequest, overrides: LoaderOptions = {}) => {\n const commonEnv = commonEnvs();\n const secretKey = overrides.secretKey || commonEnv.SECRET_KEY;\n const machineSecretKey = overrides.machineSecretKey || commonEnv.MACHINE_SECRET_KEY;\n const publishableKey = overrides.publishableKey || commonEnv.PUBLISHABLE_KEY;\n const jwtKey = overrides.jwtKey || commonEnv.CLERK_JWT_KEY;\n const apiUrl = getEnvVariable('CLERK_API_URL') || apiUrlFromPublishableKey(publishableKey);\n const domain = overrides.domain || commonEnv.DOMAIN;\n const isSatellite = overrides.isSatellite || commonEnv.IS_SATELLITE;\n const relativeOrAbsoluteProxyUrl = overrides.proxyUrl || commonEnv.PROXY_URL;\n const signInUrl = overrides.signInUrl || commonEnv.SIGN_IN_URL;\n const signUpUrl = overrides.signUpUrl || commonEnv.SIGN_UP_URL;\n const satelliteAutoSync = overrides.satelliteAutoSync;\n\n let proxyUrl;\n if (!!relativeOrAbsoluteProxyUrl && isProxyUrlRelative(relativeOrAbsoluteProxyUrl)) {\n proxyUrl = new URL(relativeOrAbsoluteProxyUrl, request.clerkUrl).toString();\n } else {\n proxyUrl = relativeOrAbsoluteProxyUrl;\n }\n\n // In keyless mode, don't throw if secretKey is missing - ClerkProvider will handle it\n if (!secretKey && !canUseKeyless) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw errorThrower.throw('Clerk: no secret key provided');\n }\n\n if (isSatellite && !proxyUrl && !domain) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw errorThrower.throw('Clerk: satellite mode requires a proxy URL or domain');\n }\n\n if (isSatellite && secretKey && !isHttpOrHttps(signInUrl) && isDevelopmentFromSecretKey(secretKey)) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw errorThrower.throw('Clerk: satellite mode requires a sign-in URL in production');\n }\n\n return {\n // used to append options that are not initialized from env\n ...overrides,\n secretKey,\n machineSecretKey,\n publishableKey,\n jwtKey,\n apiUrl,\n domain,\n isSatellite,\n proxyUrl,\n signInUrl,\n signUpUrl,\n satelliteAutoSync,\n };\n};\n"],"mappings":";;;;;;;;;AAWA,MAAa,eAAe,SAAuB,YAA2B,CAAC,MAAM;CACnF,MAAM,YAAY,WAAW;CAC7B,MAAM,YAAY,UAAU,aAAa,UAAU;CACnD,MAAM,mBAAmB,UAAU,oBAAoB,UAAU;CACjE,MAAM,iBAAiB,UAAU,kBAAkB,UAAU;CAC7D,MAAM,SAAS,UAAU,UAAU,UAAU;CAC7C,MAAM,SAAS,eAAe,eAAe,KAAK,yBAAyB,cAAc;CACzF,MAAM,SAAS,UAAU,UAAU,UAAU;CAC7C,MAAM,cAAc,UAAU,eAAe,UAAU;CACvD,MAAM,6BAA6B,UAAU,YAAY,UAAU;CACnE,MAAM,YAAY,UAAU,aAAa,UAAU;CACnD,MAAM,YAAY,UAAU,aAAa,UAAU;CACnD,MAAM,oBAAoB,UAAU;CAEpC,IAAI;CACJ,IAAI,CAAC,CAAC,8BAA8B,mBAAmB,0BAA0B,GAC/E,WAAW,IAAI,IAAI,4BAA4B,QAAQ,QAAQ,CAAC,CAAC,SAAS;MAE1E,WAAW;CAIb,IAAI,CAAC,aAAa,CAAC,eAEjB,MAAM,aAAa,MAAM,+BAA+B;CAG1D,IAAI,eAAe,CAAC,YAAY,CAAC,QAE/B,MAAM,aAAa,MAAM,sDAAsD;CAGjF,IAAI,eAAe,aAAa,CAAC,cAAc,SAAS,KAAK,2BAA2B,SAAS,GAE/F,MAAM,aAAa,MAAM,4DAA4D;CAGvF,OAAO;EAEL,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/dist/server/types.d.ts
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { MultiDomainAndOrProxyPrimitives, SignInForceRedirectUrl,
|
|
1
|
+
import { OrganizationSyncOptions } from "@clerk/backend/internal";
|
|
2
|
+
import { VerifyTokenOptions } from "@clerk/backend";
|
|
3
|
+
import { MultiDomainAndOrProxyPrimitives, SignInFallbackRedirectUrl, SignInForceRedirectUrl, SignUpFallbackRedirectUrl, SignUpForceRedirectUrl } from "@clerk/shared/types";
|
|
4
4
|
|
|
5
|
+
//#region src/server/types.d.ts
|
|
5
6
|
type ClerkMiddlewareOptions = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
publishableKey?: string;
|
|
8
|
+
jwtKey?: string;
|
|
9
|
+
secretKey?: string;
|
|
10
|
+
machineSecretKey?: string;
|
|
11
|
+
signInUrl?: string;
|
|
12
|
+
signUpUrl?: string;
|
|
13
|
+
organizationSyncOptions?: OrganizationSyncOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Controls whether satellite apps automatically sync with the primary domain on initial page load.
|
|
16
|
+
*
|
|
17
|
+
* When `false` (default), satellite apps will skip the automatic handshake if no session cookies exist,
|
|
18
|
+
* and only trigger the handshake after an explicit sign-in action. This provides the best performance
|
|
19
|
+
* by showing the satellite app immediately without attempting to sync state first.
|
|
20
|
+
*
|
|
21
|
+
* When `true`, satellite apps will automatically trigger a handshake redirect to sync authentication
|
|
22
|
+
* state with the primary domain on first load, even if no session cookies exist. Use this if you want
|
|
23
|
+
* users who are already signed in on the primary domain to be automatically recognized on the satellite.
|
|
24
|
+
*
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
satelliteAutoSync?: boolean;
|
|
27
28
|
} & Pick<VerifyTokenOptions, 'audience' | 'authorizedParties'> & MultiDomainAndOrProxyPrimitives & SignInForceRedirectUrl & SignInFallbackRedirectUrl & SignUpForceRedirectUrl & SignUpFallbackRedirectUrl;
|
|
28
29
|
type LoaderOptions = ClerkMiddlewareOptions;
|
|
29
30
|
/**
|
|
@@ -31,8 +32,9 @@ type LoaderOptions = ClerkMiddlewareOptions;
|
|
|
31
32
|
* Allows dynamic configuration based on the current request.
|
|
32
33
|
*/
|
|
33
34
|
type ClerkMiddlewareOptionsCallback = (args: {
|
|
34
|
-
|
|
35
|
+
url: URL;
|
|
35
36
|
}) => ClerkMiddlewareOptions | Promise<ClerkMiddlewareOptions>;
|
|
36
37
|
type AdditionalStateOptions = SignInFallbackRedirectUrl & SignUpFallbackRedirectUrl & SignInForceRedirectUrl & SignUpForceRedirectUrl;
|
|
37
|
-
|
|
38
|
-
export
|
|
38
|
+
//#endregion
|
|
39
|
+
export { AdditionalStateOptions, ClerkMiddlewareOptions, ClerkMiddlewareOptionsCallback, LoaderOptions };
|
|
40
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/server/types.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import '@clerk/backend';
|
|
4
|
-
import '@clerk/shared/types';
|
|
1
|
+
import { AdditionalStateOptions } from "../types.js";
|
|
2
|
+
import { RequestState } from "@clerk/backend/internal";
|
|
5
3
|
|
|
4
|
+
//#region src/server/utils/index.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Wraps obscured clerk internals with a readable `clerkState` key.
|
|
8
7
|
* This is intended to be passed into <ClerkProvider>
|
|
@@ -10,10 +9,10 @@ import '@clerk/shared/types';
|
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
11
|
declare const wrapWithClerkState: (data: any) => {
|
|
13
|
-
|
|
12
|
+
__internal_clerk_state: any;
|
|
14
13
|
};
|
|
15
14
|
declare function getResponseClerkState(requestState: RequestState, additionalStateOptions?: AdditionalStateOptions): {
|
|
16
|
-
|
|
15
|
+
__internal_clerk_state: any;
|
|
17
16
|
};
|
|
18
17
|
/**
|
|
19
18
|
* Patches request to avoid duplex issues with unidici
|
|
@@ -23,5 +22,6 @@ declare function getResponseClerkState(requestState: RequestState, additionalSta
|
|
|
23
22
|
* @internal
|
|
24
23
|
*/
|
|
25
24
|
declare const patchRequest: (request: Request) => Request;
|
|
26
|
-
|
|
25
|
+
//#endregion
|
|
27
26
|
export { getResponseClerkState, patchRequest, wrapWithClerkState };
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,62 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getEnvVariable } from "@clerk/shared/getEnvVariable";
|
|
2
|
+
import { isTruthy } from "@clerk/shared/underscore";
|
|
3
|
+
import { debugRequestState } from "@clerk/backend/internal";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
//#region src/server/utils/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Wraps obscured clerk internals with a readable `clerkState` key.
|
|
8
|
+
* This is intended to be passed into <ClerkProvider>
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
const wrapWithClerkState = (data) => {
|
|
13
|
+
return { __internal_clerk_state: { ...data } };
|
|
8
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Returns the prefetchUI config from environment variables.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
9
20
|
function getPrefetchUIFromEnv() {
|
|
10
|
-
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
return void 0;
|
|
21
|
+
if (getEnvVariable("CLERK_PREFETCH_UI") === "false") return false;
|
|
14
22
|
}
|
|
15
23
|
function getUnsafeDisableDevelopmentModeConsoleWarningFromEnv() {
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
const value = getEnvVariable("VITE_CLERK_UNSAFE_DISABLE_DEVELOPMENT_MODE_CONSOLE_WARNING") || getEnvVariable("CLERK_UNSAFE_DISABLE_DEVELOPMENT_MODE_CONSOLE_WARNING");
|
|
25
|
+
return value ? isTruthy(value) : void 0;
|
|
18
26
|
}
|
|
19
27
|
function getResponseClerkState(requestState, additionalStateOptions = {}) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return clerkInitialState;
|
|
28
|
+
const { reason, message, isSignedIn, ...rest } = requestState;
|
|
29
|
+
return wrapWithClerkState({
|
|
30
|
+
__clerk_ssr_state: rest.toAuth(),
|
|
31
|
+
__publishableKey: requestState.publishableKey,
|
|
32
|
+
__proxyUrl: requestState.proxyUrl,
|
|
33
|
+
__domain: requestState.domain,
|
|
34
|
+
__isSatellite: requestState.isSatellite,
|
|
35
|
+
__signInUrl: requestState.signInUrl,
|
|
36
|
+
__signUpUrl: requestState.signUpUrl,
|
|
37
|
+
__afterSignInUrl: requestState.afterSignInUrl,
|
|
38
|
+
__afterSignUpUrl: requestState.afterSignUpUrl,
|
|
39
|
+
__clerk_debug: debugRequestState(requestState),
|
|
40
|
+
__clerkJSUrl: getEnvVariable("CLERK_JS") || getEnvVariable("CLERK_JS_URL"),
|
|
41
|
+
__clerkJSVersion: getEnvVariable("CLERK_JS_VERSION"),
|
|
42
|
+
__clerkUIUrl: getEnvVariable("CLERK_UI_URL"),
|
|
43
|
+
__clerkUIVersion: getEnvVariable("CLERK_UI_VERSION"),
|
|
44
|
+
__prefetchUI: getPrefetchUIFromEnv(),
|
|
45
|
+
__telemetryDisabled: isTruthy(getEnvVariable("CLERK_TELEMETRY_DISABLED")),
|
|
46
|
+
__telemetryDebug: isTruthy(getEnvVariable("CLERK_TELEMETRY_DEBUG")),
|
|
47
|
+
__unsafeDisableDevelopmentModeConsoleWarning: getUnsafeDisableDevelopmentModeConsoleWarningFromEnv(),
|
|
48
|
+
__signInForceRedirectUrl: additionalStateOptions.signInForceRedirectUrl || getEnvVariable("CLERK_SIGN_IN_FORCE_REDIRECT_URL") || "",
|
|
49
|
+
__signUpForceRedirectUrl: additionalStateOptions.signUpForceRedirectUrl || getEnvVariable("CLERK_SIGN_UP_FORCE_REDIRECT_URL") || "",
|
|
50
|
+
__signInFallbackRedirectUrl: additionalStateOptions.signInFallbackRedirectUrl || getEnvVariable("CLERK_SIGN_IN_FALLBACK_REDIRECT_URL") || "",
|
|
51
|
+
__signUpFallbackRedirectUrl: additionalStateOptions.signUpFallbackRedirectUrl || getEnvVariable("CLERK_SIGN_UP_FALLBACK_REDIRECT_URL") || ""
|
|
52
|
+
});
|
|
46
53
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Patches request to avoid duplex issues with unidici
|
|
56
|
+
* For more information, see:
|
|
57
|
+
* https://github.com/nodejs/node/issues/46221
|
|
58
|
+
* https://github.com/whatwg/fetch/pull/1457
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
const patchRequest = (request) => {
|
|
62
|
+
const clonedRequest = new Request(request.url, {
|
|
63
|
+
headers: request.headers,
|
|
64
|
+
method: request.method,
|
|
65
|
+
redirect: request.redirect,
|
|
66
|
+
cache: request.cache
|
|
67
|
+
});
|
|
68
|
+
if (clonedRequest.method !== "GET" && clonedRequest.body !== null && !("duplex" in clonedRequest)) clonedRequest.duplex = "half";
|
|
69
|
+
return clonedRequest;
|
|
58
70
|
};
|
|
59
71
|
|
|
72
|
+
//#endregion
|
|
60
73
|
export { getResponseClerkState, patchRequest, wrapWithClerkState };
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
|
62
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/server/utils/index.ts"],"sourcesContent":["import type { RequestState } from '@clerk/backend/internal';\nimport { debugRequestState } from '@clerk/backend/internal';\nimport { getEnvVariable } from '@clerk/shared/getEnvVariable';\nimport { isTruthy } from '@clerk/shared/underscore';\n\nimport type { AdditionalStateOptions } from '../types';\n\n/**\n * Wraps obscured clerk internals with a readable `clerkState` key.\n * This is intended to be passed into <ClerkProvider>\n *\n * @internal\n */\nexport const wrapWithClerkState = (data: any) => {\n return { __internal_clerk_state: { ...data } };\n};\n\n/**\n * Returns the prefetchUI config from environment variables.\n *\n * @internal\n */\nfunction getPrefetchUIFromEnv(): boolean | undefined {\n if (getEnvVariable('CLERK_PREFETCH_UI') === 'false') {\n return false;\n }\n return undefined;\n}\n\nfunction getUnsafeDisableDevelopmentModeConsoleWarningFromEnv(): boolean | undefined {\n const value =\n getEnvVariable('VITE_CLERK_UNSAFE_DISABLE_DEVELOPMENT_MODE_CONSOLE_WARNING') ||\n getEnvVariable('CLERK_UNSAFE_DISABLE_DEVELOPMENT_MODE_CONSOLE_WARNING');\n\n return value ? isTruthy(value) : undefined;\n}\n\nexport function getResponseClerkState(requestState: RequestState, additionalStateOptions: AdditionalStateOptions = {}) {\n const { reason, message, isSignedIn, ...rest } = requestState;\n\n const clerkInitialState = wrapWithClerkState({\n __clerk_ssr_state: rest.toAuth(),\n __publishableKey: requestState.publishableKey,\n __proxyUrl: requestState.proxyUrl,\n __domain: requestState.domain,\n __isSatellite: requestState.isSatellite,\n __signInUrl: requestState.signInUrl,\n __signUpUrl: requestState.signUpUrl,\n __afterSignInUrl: requestState.afterSignInUrl,\n __afterSignUpUrl: requestState.afterSignUpUrl,\n __clerk_debug: debugRequestState(requestState),\n __clerkJSUrl: getEnvVariable('CLERK_JS') || getEnvVariable('CLERK_JS_URL'),\n __clerkJSVersion: getEnvVariable('CLERK_JS_VERSION'),\n __clerkUIUrl: getEnvVariable('CLERK_UI_URL'),\n __clerkUIVersion: getEnvVariable('CLERK_UI_VERSION'),\n __prefetchUI: getPrefetchUIFromEnv(),\n __telemetryDisabled: isTruthy(getEnvVariable('CLERK_TELEMETRY_DISABLED')),\n __telemetryDebug: isTruthy(getEnvVariable('CLERK_TELEMETRY_DEBUG')),\n __unsafeDisableDevelopmentModeConsoleWarning: getUnsafeDisableDevelopmentModeConsoleWarningFromEnv(),\n __signInForceRedirectUrl:\n additionalStateOptions.signInForceRedirectUrl || getEnvVariable('CLERK_SIGN_IN_FORCE_REDIRECT_URL') || '',\n __signUpForceRedirectUrl:\n additionalStateOptions.signUpForceRedirectUrl || getEnvVariable('CLERK_SIGN_UP_FORCE_REDIRECT_URL') || '',\n __signInFallbackRedirectUrl:\n additionalStateOptions.signInFallbackRedirectUrl || getEnvVariable('CLERK_SIGN_IN_FALLBACK_REDIRECT_URL') || '',\n __signUpFallbackRedirectUrl:\n additionalStateOptions.signUpFallbackRedirectUrl || getEnvVariable('CLERK_SIGN_UP_FALLBACK_REDIRECT_URL') || '',\n });\n\n return clerkInitialState;\n}\n\n/**\n * Patches request to avoid duplex issues with unidici\n * For more information, see:\n * https://github.com/nodejs/node/issues/46221\n * https://github.com/whatwg/fetch/pull/1457\n * @internal\n */\nexport const patchRequest = (request: Request) => {\n // Omit `signal` from the clone: Node 24's bundled undici tightened the\n // instanceof AbortSignal check on RequestInit.signal and rejects any signal\n // it does not recognize as its own — including the standard AbortSignal from\n // framework Request subclasses or from `new AbortController()`. Until the\n // ecosystem stabilizes, abort propagation through this clone is intentionally\n // dropped. See packages/backend/src/proxy.ts for the same workaround.\n const clonedRequest = new Request(request.url, {\n headers: request.headers,\n method: request.method,\n redirect: request.redirect,\n cache: request.cache,\n });\n\n // If duplex is not set, set it to 'half' to avoid duplex issues with unidici\n if (clonedRequest.method !== 'GET' && clonedRequest.body !== null && !('duplex' in clonedRequest)) {\n (clonedRequest as unknown as { duplex: 'half' }).duplex = 'half';\n }\n\n return clonedRequest;\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,sBAAsB,SAAc;CAC/C,OAAO,EAAE,wBAAwB,EAAE,GAAG,KAAK,EAAE;AAC/C;;;;;;AAOA,SAAS,uBAA4C;CACnD,IAAI,eAAe,mBAAmB,MAAM,SAC1C,OAAO;AAGX;AAEA,SAAS,uDAA4E;CACnF,MAAM,QACJ,eAAe,4DAA4D,KAC3E,eAAe,uDAAuD;CAExE,OAAO,QAAQ,SAAS,KAAK,IAAI;AACnC;AAEA,SAAgB,sBAAsB,cAA4B,yBAAiD,CAAC,GAAG;CACrH,MAAM,EAAE,QAAQ,SAAS,YAAY,GAAG,SAAS;CA+BjD,OA7B0B,mBAAmB;EAC3C,mBAAmB,KAAK,OAAO;EAC/B,kBAAkB,aAAa;EAC/B,YAAY,aAAa;EACzB,UAAU,aAAa;EACvB,eAAe,aAAa;EAC5B,aAAa,aAAa;EAC1B,aAAa,aAAa;EAC1B,kBAAkB,aAAa;EAC/B,kBAAkB,aAAa;EAC/B,eAAe,kBAAkB,YAAY;EAC7C,cAAc,eAAe,UAAU,KAAK,eAAe,cAAc;EACzE,kBAAkB,eAAe,kBAAkB;EACnD,cAAc,eAAe,cAAc;EAC3C,kBAAkB,eAAe,kBAAkB;EACnD,cAAc,qBAAqB;EACnC,qBAAqB,SAAS,eAAe,0BAA0B,CAAC;EACxE,kBAAkB,SAAS,eAAe,uBAAuB,CAAC;EAClE,8CAA8C,qDAAqD;EACnG,0BACE,uBAAuB,0BAA0B,eAAe,kCAAkC,KAAK;EACzG,0BACE,uBAAuB,0BAA0B,eAAe,kCAAkC,KAAK;EACzG,6BACE,uBAAuB,6BAA6B,eAAe,qCAAqC,KAAK;EAC/G,6BACE,uBAAuB,6BAA6B,eAAe,qCAAqC,KAAK;CACjH,CAEuB;AACzB;;;;;;;;AASA,MAAa,gBAAgB,YAAqB;CAOhD,MAAM,gBAAgB,IAAI,QAAQ,QAAQ,KAAK;EAC7C,SAAS,QAAQ;EACjB,QAAQ,QAAQ;EAChB,UAAU,QAAQ;EAClB,OAAO,QAAQ;CACjB,CAAC;CAGD,IAAI,cAAc,WAAW,SAAS,cAAc,SAAS,QAAQ,EAAE,YAAY,gBACjF,AAAC,cAAgD,SAAS;CAG5D,OAAO;AACT"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
import '@clerk/react/internal';
|
|
6
|
-
import 'react';
|
|
7
|
-
import '@clerk/backend';
|
|
8
|
-
import '@clerk/backend/internal';
|
|
1
|
+
import { n as TanstackStartClerkProviderProps, t as ClerkState } from "../types-DePBcrHU.js";
|
|
2
|
+
import { AdditionalStateOptions, ClerkMiddlewareOptions, LoaderOptions } from "../server/types.js";
|
|
3
|
+
export type * from "@clerk/shared/types";
|
|
4
|
+
export type { AdditionalStateOptions, ClerkMiddlewareOptions, ClerkState, LoaderOptions, TanstackStartClerkProviderProps };
|
package/dist/types/index.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ClerkProviderProps } from "@clerk/react";
|
|
2
|
+
import { Ui } from "@clerk/react/internal";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { InitialState, Without } from "@clerk/shared/types";
|
|
5
|
+
|
|
6
|
+
//#region src/client/types.d.ts
|
|
7
|
+
type ClerkState = {
|
|
8
|
+
__type: 'clerkState';
|
|
9
|
+
__internal_clerk_state: {
|
|
10
|
+
__clerk_ssr_state: InitialState;
|
|
11
|
+
__publishableKey: string | undefined;
|
|
12
|
+
__proxyUrl: string | undefined;
|
|
13
|
+
__domain: string | undefined;
|
|
14
|
+
__isSatellite: boolean;
|
|
15
|
+
__signInUrl: string | undefined;
|
|
16
|
+
__signUpUrl: string | undefined;
|
|
17
|
+
__afterSignInUrl: string | undefined;
|
|
18
|
+
__afterSignUpUrl: string | undefined;
|
|
19
|
+
__clerk_debug: any;
|
|
20
|
+
__clerkJSUrl: string | undefined;
|
|
21
|
+
__clerkJSVersion: string | undefined;
|
|
22
|
+
__clerkUIUrl: string | undefined;
|
|
23
|
+
__clerkUIVersion: string | undefined;
|
|
24
|
+
__prefetchUI: boolean | undefined;
|
|
25
|
+
__telemetryDisabled: boolean | undefined;
|
|
26
|
+
__telemetryDebug: boolean | undefined;
|
|
27
|
+
__unsafeDisableDevelopmentModeConsoleWarning: boolean | undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type TanstackStartClerkProviderProps<TUi extends Ui = Ui> = Without<ClerkProviderProps<TUi>, 'publishableKey' | 'initialState'> & {
|
|
31
|
+
publishableKey?: string;
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { TanstackStartClerkProviderProps as n, ClerkState as t };
|
|
36
|
+
//# sourceMappingURL=types-DePBcrHU.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OrganizationList, OrganizationProfile, UserProfile } from "@clerk/react";
|
|
2
|
+
import { SignInProps, SignUpProps } from "@clerk/shared/types";
|
|
3
|
+
|
|
4
|
+
//#region src/client/uiComponents.d.ts
|
|
5
|
+
declare const UserProfile$1: typeof UserProfile;
|
|
6
|
+
declare const OrganizationProfile$1: typeof OrganizationProfile;
|
|
7
|
+
declare const OrganizationList$1: typeof OrganizationList;
|
|
8
|
+
declare const SignIn$1: (props: SignInProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const SignUp$1: (props: SignUpProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { UserProfile$1 as a, SignUp$1 as i, OrganizationProfile$1 as n, SignIn$1 as r, OrganizationList$1 as t };
|
|
12
|
+
//# sourceMappingURL=uiComponents-Cle0hs-_.d.ts.map
|
package/dist/utils/env.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
//#region src/utils/env.d.ts
|
|
1
2
|
declare const getPublicEnvVariables: () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
readonly publishableKey: string;
|
|
4
|
+
readonly domain: string;
|
|
5
|
+
readonly isSatellite: boolean;
|
|
6
|
+
readonly proxyUrl: string;
|
|
7
|
+
readonly signInUrl: string;
|
|
8
|
+
readonly signUpUrl: string;
|
|
9
|
+
readonly clerkJsUrl: string;
|
|
10
|
+
readonly clerkJsVersion: string;
|
|
11
|
+
readonly clerkUIUrl: string;
|
|
12
|
+
readonly clerkUIVersion: string;
|
|
13
|
+
readonly prefetchUI: false | undefined;
|
|
14
|
+
readonly telemetryDisabled: boolean;
|
|
15
|
+
readonly telemetryDebug: boolean;
|
|
16
|
+
readonly unsafeDisableDevelopmentModeConsoleWarning: boolean;
|
|
17
|
+
readonly afterSignInUrl: string;
|
|
18
|
+
readonly afterSignUpUrl: string;
|
|
19
|
+
readonly newSubscriptionRedirectUrl: string;
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
+
//#endregion
|
|
21
22
|
export { getPublicEnvVariables };
|
|
23
|
+
//# sourceMappingURL=env.d.ts.map
|
package/dist/utils/env.js
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import { getEnvVariable } from
|
|
2
|
-
import { isTruthy } from
|
|
1
|
+
import { getEnvVariable } from "@clerk/shared/getEnvVariable";
|
|
2
|
+
import { isTruthy } from "@clerk/shared/underscore";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
newSubscriptionRedirectUrl: getValue("CLERK_CHECKOUT_CONTINUE_URL")
|
|
29
|
-
};
|
|
4
|
+
//#region src/utils/env.ts
|
|
5
|
+
const getPublicEnvVariables = () => {
|
|
6
|
+
const getValue = (name) => {
|
|
7
|
+
return getEnvVariable(`VITE_${name}`) || getEnvVariable(name);
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
publishableKey: getValue("CLERK_PUBLISHABLE_KEY"),
|
|
11
|
+
domain: getValue("CLERK_DOMAIN"),
|
|
12
|
+
isSatellite: isTruthy(getValue("CLERK_IS_SATELLITE")),
|
|
13
|
+
proxyUrl: getValue("CLERK_PROXY_URL"),
|
|
14
|
+
signInUrl: getValue("CLERK_SIGN_IN_URL"),
|
|
15
|
+
signUpUrl: getValue("CLERK_SIGN_UP_URL"),
|
|
16
|
+
clerkJsUrl: getValue("CLERK_JS_URL") || getValue("CLERK_JS"),
|
|
17
|
+
clerkJsVersion: getValue("CLERK_JS_VERSION"),
|
|
18
|
+
clerkUIUrl: getValue("CLERK_UI_URL"),
|
|
19
|
+
clerkUIVersion: getValue("CLERK_UI_VERSION"),
|
|
20
|
+
prefetchUI: getValue("CLERK_PREFETCH_UI") === "false" ? false : void 0,
|
|
21
|
+
telemetryDisabled: isTruthy(getValue("CLERK_TELEMETRY_DISABLED")),
|
|
22
|
+
telemetryDebug: isTruthy(getValue("CLERK_TELEMETRY_DEBUG")),
|
|
23
|
+
unsafeDisableDevelopmentModeConsoleWarning: isTruthy(getValue("CLERK_UNSAFE_DISABLE_DEVELOPMENT_MODE_CONSOLE_WARNING")),
|
|
24
|
+
afterSignInUrl: getValue("CLERK_AFTER_SIGN_IN_URL"),
|
|
25
|
+
afterSignUpUrl: getValue("CLERK_AFTER_SIGN_UP_URL"),
|
|
26
|
+
newSubscriptionRedirectUrl: getValue("CLERK_CHECKOUT_CONTINUE_URL")
|
|
27
|
+
};
|
|
30
28
|
};
|
|
31
29
|
|
|
30
|
+
//#endregion
|
|
32
31
|
export { getPublicEnvVariables };
|
|
33
|
-
//# sourceMappingURL=env.js.map
|
|
34
32
|
//# sourceMappingURL=env.js.map
|
package/dist/utils/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"env.js","names":[],"sources":["../../src/utils/env.ts"],"sourcesContent":["import { getEnvVariable } from '@clerk/shared/getEnvVariable';\nimport { isTruthy } from '@clerk/shared/underscore';\n\nexport const getPublicEnvVariables = () => {\n const getValue = (name: string): string => {\n return getEnvVariable(`VITE_${name}`) || getEnvVariable(name);\n };\n\n return {\n publishableKey: getValue('CLERK_PUBLISHABLE_KEY'),\n domain: getValue('CLERK_DOMAIN'),\n isSatellite: isTruthy(getValue('CLERK_IS_SATELLITE')),\n proxyUrl: getValue('CLERK_PROXY_URL'),\n signInUrl: getValue('CLERK_SIGN_IN_URL'),\n signUpUrl: getValue('CLERK_SIGN_UP_URL'),\n clerkJsUrl: getValue('CLERK_JS_URL') || getValue('CLERK_JS'),\n clerkJsVersion: getValue('CLERK_JS_VERSION'),\n clerkUIUrl: getValue('CLERK_UI_URL'),\n clerkUIVersion: getValue('CLERK_UI_VERSION'),\n prefetchUI: getValue('CLERK_PREFETCH_UI') === 'false' ? false : undefined,\n telemetryDisabled: isTruthy(getValue('CLERK_TELEMETRY_DISABLED')),\n telemetryDebug: isTruthy(getValue('CLERK_TELEMETRY_DEBUG')),\n unsafeDisableDevelopmentModeConsoleWarning: isTruthy(\n getValue('CLERK_UNSAFE_DISABLE_DEVELOPMENT_MODE_CONSOLE_WARNING'),\n ),\n afterSignInUrl: getValue('CLERK_AFTER_SIGN_IN_URL'),\n afterSignUpUrl: getValue('CLERK_AFTER_SIGN_UP_URL'),\n newSubscriptionRedirectUrl: getValue('CLERK_CHECKOUT_CONTINUE_URL'),\n } as const;\n};\n"],"mappings":";;;;AAGA,MAAa,8BAA8B;CACzC,MAAM,YAAY,SAAyB;EACzC,OAAO,eAAe,QAAQ,MAAM,KAAK,eAAe,IAAI;CAC9D;CAEA,OAAO;EACL,gBAAgB,SAAS,uBAAuB;EAChD,QAAQ,SAAS,cAAc;EAC/B,aAAa,SAAS,SAAS,oBAAoB,CAAC;EACpD,UAAU,SAAS,iBAAiB;EACpC,WAAW,SAAS,mBAAmB;EACvC,WAAW,SAAS,mBAAmB;EACvC,YAAY,SAAS,cAAc,KAAK,SAAS,UAAU;EAC3D,gBAAgB,SAAS,kBAAkB;EAC3C,YAAY,SAAS,cAAc;EACnC,gBAAgB,SAAS,kBAAkB;EAC3C,YAAY,SAAS,mBAAmB,MAAM,UAAU,QAAQ;EAChE,mBAAmB,SAAS,SAAS,0BAA0B,CAAC;EAChE,gBAAgB,SAAS,SAAS,uBAAuB,CAAC;EAC1D,4CAA4C,SAC1C,SAAS,uDAAuD,CAClE;EACA,gBAAgB,SAAS,yBAAyB;EAClD,gBAAgB,SAAS,yBAAyB;EAClD,4BAA4B,SAAS,6BAA6B;CACpE;AACF"}
|
package/dist/utils/errors.d.ts
CHANGED
package/dist/utils/errors.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/utils/errors.ts
|
|
2
|
+
const createErrorMessage = (msg) => {
|
|
3
|
+
return `🔒 Clerk: ${msg.trim()}
|
|
4
4
|
|
|
5
5
|
For more info, check out the docs: https://clerk.com/docs,
|
|
6
6
|
or come say hi in our discord server: https://clerk.com/discord
|
|
7
7
|
|
|
8
8
|
`;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
const noFetchFnCtxPassedInGetAuth = createErrorMessage(`
|
|
11
11
|
You're calling 'getAuth()' from a server function, without providing the request object.
|
|
12
12
|
Example:
|
|
13
13
|
|
|
@@ -17,11 +17,11 @@ var noFetchFnCtxPassedInGetAuth = createErrorMessage(`
|
|
|
17
17
|
...
|
|
18
18
|
});
|
|
19
19
|
`);
|
|
20
|
-
|
|
20
|
+
const clerkMiddlewareNotConfigured = createErrorMessage(`
|
|
21
21
|
It looks like you're trying to use Clerk without configuring the middleware.
|
|
22
22
|
|
|
23
23
|
To fix this, make sure you have the \`clerkMiddleware()\` configured in your \`createStart()\` function in your \`src/start.ts\` file.`);
|
|
24
24
|
|
|
25
|
+
//#endregion
|
|
25
26
|
export { clerkMiddlewareNotConfigured, noFetchFnCtxPassedInGetAuth };
|
|
26
|
-
//# sourceMappingURL=errors.js.map
|
|
27
27
|
//# sourceMappingURL=errors.js.map
|
package/dist/utils/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"errors.js","names":[],"sources":["../../src/utils/errors.ts"],"sourcesContent":["const createErrorMessage = (msg: string) => {\n return `🔒 Clerk: ${msg.trim()}\n\nFor more info, check out the docs: https://clerk.com/docs,\nor come say hi in our discord server: https://clerk.com/discord\n\n`;\n};\n\nexport const noFetchFnCtxPassedInGetAuth = createErrorMessage(`\n You're calling 'getAuth()' from a server function, without providing the request object.\n Example:\n\n export const someServerFunction = createServerFn({ method: 'GET' }).handler(async () => {\n const request = getWebRequest()\n const auth = getAuth(request);\n ...\n });\n `);\n\nexport const clerkMiddlewareNotConfigured = createErrorMessage(`\nIt looks like you're trying to use Clerk without configuring the middleware.\n\nTo fix this, make sure you have the \\`clerkMiddleware()\\` configured in your \\`createStart()\\` function in your \\`src/start.ts\\` file.`);\n"],"mappings":";AAAA,MAAM,sBAAsB,QAAgB;CAC1C,OAAO,aAAa,IAAI,KAAK,EAAE;;;;;;AAMjC;AAEA,MAAa,8BAA8B,mBAAmB;;;;;;;;;GAS3D;AAEH,MAAa,+BAA+B,mBAAmB;;;uIAGwE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/utils/feature-flags.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Whether keyless mode can be used in the current environment.
|
|
3
4
|
* Keyless mode is only available in development, when not explicitly disabled,
|
|
@@ -8,5 +9,6 @@
|
|
|
8
9
|
* - `CLERK_KEYLESS_DISABLED=1` (generic)
|
|
9
10
|
*/
|
|
10
11
|
declare const canUseKeyless: boolean;
|
|
11
|
-
|
|
12
|
+
//#endregion
|
|
12
13
|
export { canUseKeyless };
|
|
14
|
+
//# sourceMappingURL=feature-flags.d.ts.map
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import { getEnvVariable } from
|
|
2
|
-
import { isTruthy } from
|
|
3
|
-
import {
|
|
1
|
+
import { getEnvVariable } from "@clerk/shared/getEnvVariable";
|
|
2
|
+
import { isTruthy } from "@clerk/shared/underscore";
|
|
3
|
+
import { isAutomatedEnvironment, isDevelopmentEnvironment } from "@clerk/shared/utils";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
//#region src/utils/feature-flags.ts
|
|
6
|
+
const KEYLESS_DISABLED = isTruthy(getEnvVariable("VITE_CLERK_KEYLESS_DISABLED")) || isTruthy(getEnvVariable("CLERK_KEYLESS_DISABLED")) || false;
|
|
7
|
+
/**
|
|
8
|
+
* Whether keyless mode can be used in the current environment.
|
|
9
|
+
* Keyless mode is only available in development, when not explicitly disabled,
|
|
10
|
+
* and when not running in an automated/CI environment.
|
|
11
|
+
*
|
|
12
|
+
* To disable keyless mode, set either:
|
|
13
|
+
* - `VITE_CLERK_KEYLESS_DISABLED=1` (for Vite-based projects)
|
|
14
|
+
* - `CLERK_KEYLESS_DISABLED=1` (generic)
|
|
15
|
+
*/
|
|
16
|
+
const canUseKeyless = isDevelopmentEnvironment() && !isAutomatedEnvironment() && !KEYLESS_DISABLED;
|
|
8
17
|
|
|
18
|
+
//#endregion
|
|
9
19
|
export { canUseKeyless };
|
|
10
|
-
//# sourceMappingURL=feature-flags.js.map
|
|
11
20
|
//# sourceMappingURL=feature-flags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"feature-flags.js","names":[],"sources":["../../src/utils/feature-flags.ts"],"sourcesContent":["import { getEnvVariable } from '@clerk/shared/getEnvVariable';\nimport { isTruthy } from '@clerk/shared/underscore';\nimport { isAutomatedEnvironment, isDevelopmentEnvironment } from '@clerk/shared/utils';\n\n// Support both Vite-style and generic env var names for disabling keyless mode\nconst KEYLESS_DISABLED =\n isTruthy(getEnvVariable('VITE_CLERK_KEYLESS_DISABLED')) ||\n isTruthy(getEnvVariable('CLERK_KEYLESS_DISABLED')) ||\n false;\n\n/**\n * Whether keyless mode can be used in the current environment.\n * Keyless mode is only available in development, when not explicitly disabled,\n * and when not running in an automated/CI environment.\n *\n * To disable keyless mode, set either:\n * - `VITE_CLERK_KEYLESS_DISABLED=1` (for Vite-based projects)\n * - `CLERK_KEYLESS_DISABLED=1` (generic)\n */\nexport const canUseKeyless = isDevelopmentEnvironment() && !isAutomatedEnvironment() && !KEYLESS_DISABLED;\n"],"mappings":";;;;;AAKA,MAAM,mBACJ,SAAS,eAAe,6BAA6B,CAAC,KACtD,SAAS,eAAe,wBAAwB,CAAC,KACjD;;;;;;;;;;AAWF,MAAa,gBAAgB,yBAAyB,KAAK,CAAC,uBAAuB,KAAK,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/utils/index.d.ts
|
|
3
2
|
declare const isClient: () => boolean;
|
|
4
3
|
declare const isServer: () => boolean;
|
|
5
|
-
declare const errorThrower:
|
|
6
|
-
|
|
4
|
+
declare const errorThrower: import("@clerk/shared/error").ErrorThrower;
|
|
5
|
+
//#endregion
|
|
7
6
|
export { errorThrower, isClient, isServer };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { buildErrorThrower } from
|
|
1
|
+
import { buildErrorThrower } from "@clerk/shared/error";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
packageName: "@clerk/tanstack-react-start"
|
|
8
|
-
});
|
|
3
|
+
//#region src/utils/index.ts
|
|
4
|
+
const isClient = () => typeof window !== "undefined";
|
|
5
|
+
const isServer = () => !isClient();
|
|
6
|
+
const errorThrower = buildErrorThrower({ packageName: "@clerk/tanstack-react-start" });
|
|
9
7
|
|
|
8
|
+
//#endregion
|
|
10
9
|
export { errorThrower, isClient, isServer };
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
12
10
|
//# sourceMappingURL=index.js.map
|