@clerk/react-router 3.4.1 → 3.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/ReactRouterClerkProvider-trOD2EJy.d.ts +17 -0
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +3 -3
- package/dist/client/ReactRouterClerkProvider.d.ts +2 -13
- package/dist/client/ReactRouterClerkProvider.js +75 -121
- package/dist/client/ReactRouterClerkProvider.js.map +1 -1
- package/dist/client/ReactRouterOptionsContext.d.ts +6 -7
- package/dist/client/ReactRouterOptionsContext.js +11 -12
- package/dist/client/ReactRouterOptionsContext.js.map +1 -1
- package/dist/client/index.d.ts +4 -9
- package/dist/client/index.js +4 -12
- package/dist/client/types.d.ts +2 -56
- package/dist/client/types.js +1 -1
- package/dist/client/uiComponents.d.ts +2 -10
- package/dist/client/uiComponents.js +21 -34
- package/dist/client/uiComponents.js.map +1 -1
- package/dist/client/useAwaitableNavigate.d.ts +4 -2
- package/dist/client/useAwaitableNavigate.js +22 -21
- package/dist/client/useAwaitableNavigate.js.map +1 -1
- package/dist/client/usePathnameWithoutSplatRouteParams.d.ts +3 -1
- package/dist/client/usePathnameWithoutSplatRouteParams.js +10 -12
- package/dist/client/usePathnameWithoutSplatRouteParams.js.map +1 -1
- package/dist/errorThrower.d.ts +4 -4
- package/dist/errorThrower.js +6 -5
- package/dist/errorThrower.js.map +1 -1
- package/dist/errors.d.ts +2 -4
- package/dist/errors.js +3 -28
- package/dist/global.d.ts +1 -0
- package/dist/index.d.ts +6 -9
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -1
- package/dist/legacy.js +2 -6
- package/dist/loadOptions-DNSRkrk0.d.ts +63 -0
- package/dist/server/clerkClient.d.ts +6 -8
- package/dist/server/clerkClient.js +19 -19
- package/dist/server/clerkClient.js.map +1 -1
- package/dist/server/clerkMiddleware.d.ts +12 -11
- package/dist/server/clerkMiddleware.js +83 -90
- package/dist/server/clerkMiddleware.js.map +1 -1
- package/dist/server/getAuth.d.ts +5 -3
- package/dist/server/getAuth.js +16 -23
- package/dist/server/getAuth.js.map +1 -1
- package/dist/server/index.d.ts +6 -10
- package/dist/server/index.js +5 -10
- package/dist/server/keyless/fileStorage.d.ts +6 -5
- package/dist/server/keyless/fileStorage.js +12 -11
- package/dist/server/keyless/fileStorage.js.map +1 -1
- package/dist/server/keyless/index.d.ts +6 -9
- package/dist/server/keyless/index.js +34 -40
- package/dist/server/keyless/index.js.map +1 -1
- package/dist/server/keyless/utils.d.ts +8 -11
- package/dist/server/keyless/utils.js +10 -12
- package/dist/server/keyless/utils.js.map +1 -1
- package/dist/server/loadOptions.d.ts +2 -64
- package/dist/server/loadOptions.js +50 -63
- package/dist/server/loadOptions.js.map +1 -1
- package/dist/server/rootAuthLoader.d.ts +17 -16
- package/dist/server/rootAuthLoader.js +45 -71
- package/dist/server/rootAuthLoader.js.map +1 -1
- package/dist/server/types.d.ts +2 -84
- package/dist/server/types.js +1 -1
- package/dist/server/utils.d.ts +13 -13
- package/dist/server/utils.js +93 -83
- package/dist/server/utils.js.map +1 -1
- package/dist/ssr/index.d.ts +4 -7
- package/dist/ssr/index.js +5 -5
- package/dist/ssr/index.js.map +1 -1
- package/dist/types/index.d.ts +4 -9
- package/dist/types/index.js +1 -1
- package/dist/types-C3uAu7q3.d.ts +58 -0
- package/dist/types-CkBFvMvW.d.ts +86 -0
- package/dist/uiComponents-CuYpqdGX.d.ts +12 -0
- package/dist/utils/assert.d.ts +4 -6
- package/dist/utils/assert.js +20 -29
- package/dist/utils/assert.js.map +1 -1
- package/dist/utils/env.d.ts +25 -23
- package/dist/utils/env.js +32 -33
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/errors.d.ts +3 -1
- package/dist/utils/errors.js +15 -24
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/feature-flags.d.ts +3 -1
- package/dist/utils/feature-flags.js +7 -6
- package/dist/utils/feature-flags.js.map +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/dist/webhooks.js +3 -3
- package/package.json +6 -6
- package/dist/api/index.js.map +0 -1
- 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/global.d.d.ts +0 -2
- package/dist/global.d.js +0 -1
- 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
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
__signInForceRedirectUrl: string | undefined;
|
|
18
|
+
__signUpForceRedirectUrl: string | undefined;
|
|
19
|
+
__signInFallbackRedirectUrl: string | undefined;
|
|
20
|
+
__signUpFallbackRedirectUrl: string | undefined;
|
|
21
|
+
__clerk_debug: any;
|
|
22
|
+
__clerkJSUrl: string | undefined;
|
|
23
|
+
__clerkJSVersion: string | undefined;
|
|
24
|
+
__clerkUIUrl: string | undefined;
|
|
25
|
+
__clerkUIVersion: string | undefined;
|
|
26
|
+
__prefetchUI: boolean | undefined;
|
|
27
|
+
__telemetryDisabled: boolean | undefined;
|
|
28
|
+
__telemetryDebug: boolean | undefined;
|
|
29
|
+
__unsafeDisableDevelopmentModeConsoleWarning: boolean | undefined;
|
|
30
|
+
__keylessClaimUrl?: string;
|
|
31
|
+
__keylessApiKeysUrl?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
type WithClerkState<U = any> = {
|
|
35
|
+
data: U;
|
|
36
|
+
clerkState: {
|
|
37
|
+
__type: 'clerkState';
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type ReactRouterClerkProviderProps<TUi extends Ui = Ui> = Without<ClerkProviderProps<TUi>, 'publishableKey' | 'initialState'> & {
|
|
41
|
+
/**
|
|
42
|
+
* Used to override the default VITE_CLERK_PUBLISHABLE_KEY env variable if needed.
|
|
43
|
+
* This is optional for React Router (in SSR mode) as the ClerkProvider will automatically use the VITE_CLERK_PUBLISHABLE_KEY env variable if it exists.
|
|
44
|
+
* If you use React Router in SPA mode or as a library, you have to pass the publishableKey prop.
|
|
45
|
+
*/
|
|
46
|
+
publishableKey?: string;
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
};
|
|
49
|
+
declare global {
|
|
50
|
+
interface Window {
|
|
51
|
+
__reactRouterContext: {
|
|
52
|
+
isSpaMode?: boolean;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { ReactRouterClerkProviderProps as n, WithClerkState as r, ClerkState as t };
|
|
58
|
+
//# sourceMappingURL=types-C3uAu7q3.d.ts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { LoaderFunction, LoaderFunctionArgs, UNSAFE_DataWithResponseInit } from "react-router";
|
|
2
|
+
import { Organization, Session, User, VerifyTokenOptions } from "@clerk/backend";
|
|
3
|
+
import { OrganizationSyncOptions, RequestState, SignedInAuthObject, SignedOutAuthObject } from "@clerk/backend/internal";
|
|
4
|
+
import { MultiDomainAndOrProxy, SignInFallbackRedirectUrl, SignInForceRedirectUrl, SignUpFallbackRedirectUrl, SignUpForceRedirectUrl } from "@clerk/shared/types";
|
|
5
|
+
|
|
6
|
+
//#region src/server/types.d.ts
|
|
7
|
+
type GetAuthReturn = Promise<SignedInAuthObject | SignedOutAuthObject>;
|
|
8
|
+
type ClerkMiddlewareOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Used to override the default VITE_CLERK_PUBLISHABLE_KEY env variable if needed.
|
|
11
|
+
*/
|
|
12
|
+
publishableKey?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Used to override the CLERK_JWT_KEY env variable if needed.
|
|
15
|
+
*/
|
|
16
|
+
jwtKey?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Used to override the CLERK_SECRET_KEY env variable if needed.
|
|
19
|
+
*/
|
|
20
|
+
secretKey?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Used to override the CLERK_MACHINE_SECRET_KEY env variable if needed.
|
|
23
|
+
*/
|
|
24
|
+
machineSecretKey?: string;
|
|
25
|
+
signInUrl?: string;
|
|
26
|
+
signUpUrl?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Used to activate a specific [Organization](https://clerk.com/docs/guides/organizations/overview) or [Personal Account](https://clerk.com/docs/guides/dashboard/overview) based on URL path parameters. If there's a mismatch between the Active Organization in the session (e.g., as reported by `auth()`) and the Organization indicated by the URL, an attempt to activate the Organization specified in the URL will be made.
|
|
29
|
+
*
|
|
30
|
+
* If the activation can't be performed, either because an Organization doesn't exist or the user lacks access, the Active Organization in the session won't be changed. Ultimately, it's the responsibility of the page to verify that the resources are appropriate to render given the URL and handle mismatches appropriately (e.g., by returning a 404).
|
|
31
|
+
*/
|
|
32
|
+
organizationSyncOptions?: OrganizationSyncOptions;
|
|
33
|
+
} & Pick<VerifyTokenOptions, 'audience' | 'authorizedParties'> & MultiDomainAndOrProxy & SignInForceRedirectUrl & SignInFallbackRedirectUrl & SignUpForceRedirectUrl & SignUpFallbackRedirectUrl;
|
|
34
|
+
type RootAuthLoaderOptions = ClerkMiddlewareOptions & {
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use [session token claims](https://clerk.com/docs/backend-requests/making/custom-session-token) instead.
|
|
37
|
+
*/
|
|
38
|
+
loadUser?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Use [session token claims](https://clerk.com/docs/backend-requests/making/custom-session-token) instead.
|
|
41
|
+
*/
|
|
42
|
+
loadSession?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Use [session token claims](https://clerk.com/docs/backend-requests/making/custom-session-token) instead.
|
|
45
|
+
*/
|
|
46
|
+
loadOrganization?: boolean;
|
|
47
|
+
};
|
|
48
|
+
interface KeylessUrls {
|
|
49
|
+
__keylessClaimUrl?: string;
|
|
50
|
+
__keylessApiKeysUrl?: string;
|
|
51
|
+
}
|
|
52
|
+
type AdditionalStateOptions = SignInFallbackRedirectUrl & SignUpFallbackRedirectUrl & SignInForceRedirectUrl & SignUpForceRedirectUrl & KeylessUrls;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated This type is no longer used internally. Use `AdditionalStateOptions` instead.
|
|
55
|
+
*/
|
|
56
|
+
type RequestStateWithRedirectUrls = RequestState & SignInForceRedirectUrl & SignInFallbackRedirectUrl & SignUpForceRedirectUrl & SignUpFallbackRedirectUrl & KeylessUrls;
|
|
57
|
+
type RootAuthLoaderCallback<Options extends RootAuthLoaderOptions> = (args: LoaderFunctionArgsWithAuth<Options>) => RootAuthLoaderCallbackReturn;
|
|
58
|
+
type ObjectLike = Record<string, unknown> | null;
|
|
59
|
+
/**
|
|
60
|
+
* We are not using `LoaderFunctionReturn` here because we can't support non-object return values. We need to be able to decorate the return value with authentication state, and so we need something object-like.
|
|
61
|
+
*
|
|
62
|
+
* In the case of `null`, we will return an object containing only the authentication state.
|
|
63
|
+
*/
|
|
64
|
+
type RootAuthLoaderCallbackReturn = Promise<Response> | Response | Promise<ObjectLike> | ObjectLike | UNSAFE_DataWithResponseInit<unknown> | Promise<UNSAFE_DataWithResponseInit<unknown>>;
|
|
65
|
+
type LoaderFunctionReturn = ReturnType<LoaderFunction>;
|
|
66
|
+
type LoaderFunctionArgsWithAuth<Options extends RootAuthLoaderOptions = any> = LoaderFunctionArgs & {
|
|
67
|
+
request: RequestWithAuth<Options>;
|
|
68
|
+
};
|
|
69
|
+
type RequestWithAuth<Options extends RootAuthLoaderOptions = any> = LoaderFunctionArgs['request'] & {
|
|
70
|
+
auth: Omit<SignedInAuthObject | SignedOutAuthObject, 'session' | 'user' | 'organization'>;
|
|
71
|
+
} & (Options extends {
|
|
72
|
+
loadSession: true;
|
|
73
|
+
} ? {
|
|
74
|
+
session: Session | null;
|
|
75
|
+
} : object) & (Options extends {
|
|
76
|
+
loadUser: true;
|
|
77
|
+
} ? {
|
|
78
|
+
user: User | null;
|
|
79
|
+
} : object) & (Options extends {
|
|
80
|
+
loadOrganization: true;
|
|
81
|
+
} ? {
|
|
82
|
+
organization: Organization | null;
|
|
83
|
+
} : object);
|
|
84
|
+
//#endregion
|
|
85
|
+
export { LoaderFunctionArgsWithAuth as a, RequestWithAuth as c, KeylessUrls as i, RootAuthLoaderCallback as l, ClerkMiddlewareOptions as n, LoaderFunctionReturn as o, GetAuthReturn as r, RequestStateWithRedirectUrls as s, AdditionalStateOptions as t, RootAuthLoaderOptions as u };
|
|
86
|
+
//# sourceMappingURL=types-CkBFvMvW.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OrganizationProfile, UserProfile } from "@clerk/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { SignInProps, SignUpProps } from "@clerk/shared/types";
|
|
4
|
+
|
|
5
|
+
//#region src/client/uiComponents.d.ts
|
|
6
|
+
declare const UserProfile$1: typeof UserProfile;
|
|
7
|
+
declare const OrganizationProfile$1: typeof OrganizationProfile;
|
|
8
|
+
declare const SignIn$1: (props: SignInProps) => React.JSX.Element;
|
|
9
|
+
declare const SignUp$1: (props: SignUpProps) => React.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { UserProfile$1 as i, SignIn$1 as n, SignUp$1 as r, OrganizationProfile$1 as t };
|
|
12
|
+
//# sourceMappingURL=uiComponents-CuYpqdGX.d.ts.map
|
package/dist/utils/assert.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { ClerkState } from
|
|
2
|
-
import '@clerk/react';
|
|
3
|
-
import '@clerk/react/internal';
|
|
4
|
-
import '@clerk/shared/types';
|
|
5
|
-
import 'react';
|
|
1
|
+
import { t as ClerkState } from "../types-C3uAu7q3.js";
|
|
6
2
|
|
|
3
|
+
//#region src/utils/assert.d.ts
|
|
7
4
|
declare function warnForSsr(val: ClerkState | undefined): void;
|
|
8
5
|
declare function assertEnvVar(name: any, errorMessage: string): asserts name is string;
|
|
9
6
|
declare function assertValidClerkState(val: any): asserts val is ClerkState | undefined;
|
|
@@ -17,5 +14,6 @@ declare function assertPublishableKeyInSpaMode(key: any): asserts key is string;
|
|
|
17
14
|
* So in library mode we can't determine if we are in SPA mode or not so we return undefined.
|
|
18
15
|
*/
|
|
19
16
|
declare const isSpaMode: () => boolean | undefined;
|
|
20
|
-
|
|
17
|
+
//#endregion
|
|
21
18
|
export { assertEnvVar, assertPublishableKeyInSpaMode, assertValidClerkState, isSpaMode, warnForSsr };
|
|
19
|
+
//# sourceMappingURL=assert.d.ts.map
|
package/dist/utils/assert.js
CHANGED
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
// src/utils/assert.ts
|
|
2
1
|
import { invalidClerkStatePropError, noClerkStateError, publishableKeyMissingErrorInSpaMode } from "./errors.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/assert.ts
|
|
3
4
|
function warnForSsr(val) {
|
|
4
|
-
|
|
5
|
-
console.warn(noClerkStateError);
|
|
6
|
-
}
|
|
5
|
+
if (!val || !val.__internal_clerk_state) console.warn(noClerkStateError);
|
|
7
6
|
}
|
|
8
7
|
function assertEnvVar(name, errorMessage) {
|
|
9
|
-
|
|
10
|
-
throw new Error(errorMessage);
|
|
11
|
-
}
|
|
8
|
+
if (!name || typeof name !== "string") throw new Error(errorMessage);
|
|
12
9
|
}
|
|
13
10
|
function assertValidClerkState(val) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
if (!!val && !val.__internal_clerk_state) {
|
|
18
|
-
throw new Error(invalidClerkStatePropError);
|
|
19
|
-
}
|
|
11
|
+
if (!val) throw new Error(noClerkStateError);
|
|
12
|
+
if (!!val && !val.__internal_clerk_state) throw new Error(invalidClerkStatePropError);
|
|
20
13
|
}
|
|
21
14
|
function assertPublishableKeyInSpaMode(key) {
|
|
22
|
-
|
|
23
|
-
throw new Error(publishableKeyMissingErrorInSpaMode);
|
|
24
|
-
}
|
|
15
|
+
if (!key || typeof key !== "string") throw new Error(publishableKeyMissingErrorInSpaMode);
|
|
25
16
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
assertValidClerkState,
|
|
37
|
-
isSpaMode,
|
|
38
|
-
warnForSsr
|
|
17
|
+
/**
|
|
18
|
+
* When React Router is used as a framework, the __reactRouterContext object is populated on window.
|
|
19
|
+
* The isSpaMode will then be set to true if you use https://reactrouter.com/how-to/spa or when you deactivate SSR
|
|
20
|
+
*
|
|
21
|
+
* When React Router is used as a library the __reactRouterContext object is not populated on window at all.
|
|
22
|
+
*
|
|
23
|
+
* So in library mode we can't determine if we are in SPA mode or not so we return undefined.
|
|
24
|
+
*/
|
|
25
|
+
const isSpaMode = () => {
|
|
26
|
+
if (typeof window !== "undefined" && typeof window.__reactRouterContext?.isSpaMode !== "undefined") return window.__reactRouterContext.isSpaMode;
|
|
39
27
|
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { assertEnvVar, assertPublishableKeyInSpaMode, assertValidClerkState, isSpaMode, warnForSsr };
|
|
40
31
|
//# sourceMappingURL=assert.js.map
|
package/dist/utils/assert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/assert.ts"],"sourcesContent":["import type { ClerkState } from '../client/types';\nimport { invalidClerkStatePropError, noClerkStateError, publishableKeyMissingErrorInSpaMode } from './errors';\n\nexport function warnForSsr(val: ClerkState | undefined) {\n if (!val || !val.__internal_clerk_state) {\n console.warn(noClerkStateError);\n }\n}\n\nexport function assertEnvVar(name: any, errorMessage: string): asserts name is string {\n if (!name || typeof name !== 'string') {\n throw new Error(errorMessage);\n }\n}\n\nexport function assertValidClerkState(val: any): asserts val is ClerkState | undefined {\n if (!val) {\n throw new Error(noClerkStateError);\n }\n if (!!val && !val.__internal_clerk_state) {\n throw new Error(invalidClerkStatePropError);\n }\n}\n\nexport function assertPublishableKeyInSpaMode(key: any): asserts key is string {\n if (!key || typeof key !== 'string') {\n throw new Error(publishableKeyMissingErrorInSpaMode);\n }\n}\n\n/**\n * When React Router is used as a framework, the __reactRouterContext object is populated on window.\n * The isSpaMode will then be set to true if you use https://reactrouter.com/how-to/spa or when you deactivate SSR\n *\n * When React Router is used as a library the __reactRouterContext object is not populated on window at all.\n *\n * So in library mode we can't determine if we are in SPA mode or not so we return undefined.\n */\nexport const isSpaMode = (): boolean | undefined => {\n if (typeof window !== 'undefined' && typeof window.__reactRouterContext?.isSpaMode !== 'undefined') {\n return window.__reactRouterContext.isSpaMode;\n }\n return undefined;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"assert.js","names":[],"sources":["../../src/utils/assert.ts"],"sourcesContent":["import type { ClerkState } from '../client/types';\nimport { invalidClerkStatePropError, noClerkStateError, publishableKeyMissingErrorInSpaMode } from './errors';\n\nexport function warnForSsr(val: ClerkState | undefined) {\n if (!val || !val.__internal_clerk_state) {\n console.warn(noClerkStateError);\n }\n}\n\nexport function assertEnvVar(name: any, errorMessage: string): asserts name is string {\n if (!name || typeof name !== 'string') {\n throw new Error(errorMessage);\n }\n}\n\nexport function assertValidClerkState(val: any): asserts val is ClerkState | undefined {\n if (!val) {\n throw new Error(noClerkStateError);\n }\n if (!!val && !val.__internal_clerk_state) {\n throw new Error(invalidClerkStatePropError);\n }\n}\n\nexport function assertPublishableKeyInSpaMode(key: any): asserts key is string {\n if (!key || typeof key !== 'string') {\n throw new Error(publishableKeyMissingErrorInSpaMode);\n }\n}\n\n/**\n * When React Router is used as a framework, the __reactRouterContext object is populated on window.\n * The isSpaMode will then be set to true if you use https://reactrouter.com/how-to/spa or when you deactivate SSR\n *\n * When React Router is used as a library the __reactRouterContext object is not populated on window at all.\n *\n * So in library mode we can't determine if we are in SPA mode or not so we return undefined.\n */\nexport const isSpaMode = (): boolean | undefined => {\n if (typeof window !== 'undefined' && typeof window.__reactRouterContext?.isSpaMode !== 'undefined') {\n return window.__reactRouterContext.isSpaMode;\n }\n return undefined;\n};\n"],"mappings":";;;AAGA,SAAgB,WAAW,KAA6B;CACtD,IAAI,CAAC,OAAO,CAAC,IAAI,wBACf,QAAQ,KAAK,iBAAiB;AAElC;AAEA,SAAgB,aAAa,MAAW,cAA8C;CACpF,IAAI,CAAC,QAAQ,OAAO,SAAS,UAC3B,MAAM,IAAI,MAAM,YAAY;AAEhC;AAEA,SAAgB,sBAAsB,KAAiD;CACrF,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,iBAAiB;CAEnC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,wBAChB,MAAM,IAAI,MAAM,0BAA0B;AAE9C;AAEA,SAAgB,8BAA8B,KAAiC;CAC7E,IAAI,CAAC,OAAO,OAAO,QAAQ,UACzB,MAAM,IAAI,MAAM,mCAAmC;AAEvD;;;;;;;;;AAUA,MAAa,kBAAuC;CAClD,IAAI,OAAO,WAAW,eAAe,OAAO,OAAO,sBAAsB,cAAc,aACrF,OAAO,OAAO,qBAAqB;AAGvC"}
|
package/dist/utils/env.d.ts
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { AppLoadContext } from
|
|
1
|
+
import { AppLoadContext } from "react-router";
|
|
2
2
|
|
|
3
|
+
//#region src/utils/env.d.ts
|
|
3
4
|
declare const getPublicEnvVariables: (context: AppLoadContext | undefined) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
publishableKey: string;
|
|
6
|
+
domain: string;
|
|
7
|
+
isSatellite: boolean;
|
|
8
|
+
proxyUrl: string;
|
|
9
|
+
signInUrl: string;
|
|
10
|
+
signUpUrl: string;
|
|
11
|
+
clerkJsUrl: string;
|
|
12
|
+
clerkJsVersion: string;
|
|
13
|
+
clerkUIUrl: string;
|
|
14
|
+
clerkUIVersion: string;
|
|
15
|
+
prefetchUI: boolean | undefined;
|
|
16
|
+
telemetryDisabled: boolean;
|
|
17
|
+
telemetryDebug: boolean;
|
|
18
|
+
unsafeDisableDevelopmentModeConsoleWarning: boolean;
|
|
19
|
+
signInForceRedirectUrl: string;
|
|
20
|
+
signUpForceRedirectUrl: string;
|
|
21
|
+
signInFallbackRedirectUrl: string;
|
|
22
|
+
signUpFallbackRedirectUrl: string;
|
|
23
|
+
afterSignInUrl: string;
|
|
24
|
+
afterSignUpUrl: string;
|
|
25
|
+
newSubscriptionRedirectUrl: string;
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
//#endregion
|
|
27
28
|
export { getPublicEnvVariables };
|
|
29
|
+
//# sourceMappingURL=env.d.ts.map
|
package/dist/utils/env.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
// src/utils/env.ts
|
|
2
1
|
import { getEnvVariable } from "@clerk/shared/getEnvVariable";
|
|
3
2
|
import { isTruthy } from "@clerk/shared/underscore";
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
getPublicEnvVariables
|
|
3
|
+
|
|
4
|
+
//#region src/utils/env.ts
|
|
5
|
+
const getPublicEnvVariables = (context) => {
|
|
6
|
+
const getValue = (name) => {
|
|
7
|
+
return getEnvVariable(`VITE_${name}`, context) || getEnvVariable(name, context);
|
|
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"),
|
|
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
|
+
signInForceRedirectUrl: getValue("CLERK_SIGN_IN_FORCE_REDIRECT_URL"),
|
|
25
|
+
signUpForceRedirectUrl: getValue("CLERK_SIGN_UP_FORCE_REDIRECT_URL"),
|
|
26
|
+
signInFallbackRedirectUrl: getValue("CLERK_SIGN_IN_FALLBACK_REDIRECT_URL"),
|
|
27
|
+
signUpFallbackRedirectUrl: getValue("CLERK_SIGN_UP_FALLBACK_REDIRECT_URL"),
|
|
28
|
+
afterSignInUrl: getValue("CLERK_AFTER_SIGN_IN_URL"),
|
|
29
|
+
afterSignUpUrl: getValue("CLERK_AFTER_SIGN_UP_URL"),
|
|
30
|
+
newSubscriptionRedirectUrl: getValue("CLERK_CHECKOUT_CONTINUE_URL")
|
|
31
|
+
};
|
|
36
32
|
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { getPublicEnvVariables };
|
|
37
36
|
//# sourceMappingURL=env.js.map
|
package/dist/utils/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/env.ts"],"sourcesContent":["import { getEnvVariable } from '@clerk/shared/getEnvVariable';\nimport { isTruthy } from '@clerk/shared/underscore';\nimport type { AppLoadContext } from 'react-router';\n\nexport const getPublicEnvVariables = (context: AppLoadContext | undefined) => {\n const getValue = (name: string): string => {\n return getEnvVariable(`VITE_${name}`, context) || getEnvVariable(name, context);\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'),\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 signInForceRedirectUrl: getValue('CLERK_SIGN_IN_FORCE_REDIRECT_URL'),\n signUpForceRedirectUrl: getValue('CLERK_SIGN_UP_FORCE_REDIRECT_URL'),\n signInFallbackRedirectUrl: getValue('CLERK_SIGN_IN_FALLBACK_REDIRECT_URL'),\n signUpFallbackRedirectUrl: getValue('CLERK_SIGN_UP_FALLBACK_REDIRECT_URL'),\n afterSignInUrl: getValue('CLERK_AFTER_SIGN_IN_URL'),\n afterSignUpUrl: getValue('CLERK_AFTER_SIGN_UP_URL'),\n newSubscriptionRedirectUrl: getValue('CLERK_CHECKOUT_CONTINUE_URL'),\n };\n};\n"],"mappings":"
|
|
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';\nimport type { AppLoadContext } from 'react-router';\n\nexport const getPublicEnvVariables = (context: AppLoadContext | undefined) => {\n const getValue = (name: string): string => {\n return getEnvVariable(`VITE_${name}`, context) || getEnvVariable(name, context);\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'),\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 signInForceRedirectUrl: getValue('CLERK_SIGN_IN_FORCE_REDIRECT_URL'),\n signUpForceRedirectUrl: getValue('CLERK_SIGN_UP_FORCE_REDIRECT_URL'),\n signInFallbackRedirectUrl: getValue('CLERK_SIGN_IN_FALLBACK_REDIRECT_URL'),\n signUpFallbackRedirectUrl: getValue('CLERK_SIGN_UP_FALLBACK_REDIRECT_URL'),\n afterSignInUrl: getValue('CLERK_AFTER_SIGN_IN_URL'),\n afterSignUpUrl: getValue('CLERK_AFTER_SIGN_UP_URL'),\n newSubscriptionRedirectUrl: getValue('CLERK_CHECKOUT_CONTINUE_URL'),\n };\n};\n"],"mappings":";;;;AAIA,MAAa,yBAAyB,YAAwC;CAC5E,MAAM,YAAY,SAAyB;EACzC,OAAO,eAAe,QAAQ,QAAQ,OAAO,KAAK,eAAe,MAAM,OAAO;CAChF;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;EACnC,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,wBAAwB,SAAS,kCAAkC;EACnE,wBAAwB,SAAS,kCAAkC;EACnE,2BAA2B,SAAS,qCAAqC;EACzE,2BAA2B,SAAS,qCAAqC;EACzE,gBAAgB,SAAS,yBAAyB;EAClD,gBAAgB,SAAS,yBAAyB;EAClD,4BAA4B,SAAS,6BAA6B;CACpE;AACF"}
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/utils/errors.d.ts
|
|
1
2
|
declare const invalidClerkStatePropError: string;
|
|
2
3
|
declare const noClerkStateError: string;
|
|
3
4
|
declare const noLoaderArgsPassedInGetAuth: string;
|
|
@@ -6,5 +7,6 @@ declare const noSecretKeyError: string;
|
|
|
6
7
|
declare const satelliteAndMissingProxyUrlAndDomain: string;
|
|
7
8
|
declare const satelliteAndMissingSignInUrl: string;
|
|
8
9
|
declare const publishableKeyMissingErrorInSpaMode: string;
|
|
9
|
-
|
|
10
|
+
//#endregion
|
|
10
11
|
export { invalidClerkStatePropError, invalidRootLoaderCallbackReturn, noClerkStateError, noLoaderArgsPassedInGetAuth, noSecretKeyError, publishableKeyMissingErrorInSpaMode, satelliteAndMissingProxyUrlAndDomain, satelliteAndMissingSignInUrl };
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
+
const ssrExample = `Use 'rootAuthLoader' as your root loader. Then, add <ClerkProvider> to your app.
|
|
10
10
|
Example:
|
|
11
11
|
|
|
12
12
|
import { rootAuthLoader } from '@clerk/react-router/ssr.server'
|
|
@@ -24,17 +24,17 @@ export default function App({ loaderData }: Route.ComponentProps) {
|
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
|
-
|
|
27
|
+
const invalidClerkStatePropError = createErrorMessage(`
|
|
28
28
|
You're trying to pass an invalid object in "<ClerkProvider clerkState={...}>".
|
|
29
29
|
|
|
30
30
|
${ssrExample}
|
|
31
31
|
`);
|
|
32
|
-
|
|
32
|
+
const noClerkStateError = createErrorMessage(`
|
|
33
33
|
Looks like you didn't pass 'clerkState' to "<ClerkProvider clerkState={...}>".
|
|
34
34
|
|
|
35
35
|
${ssrExample}
|
|
36
36
|
`);
|
|
37
|
-
|
|
37
|
+
const noLoaderArgsPassedInGetAuth = createErrorMessage(`
|
|
38
38
|
You're calling 'getAuth()' from a loader, without providing the loader args object.
|
|
39
39
|
Example:
|
|
40
40
|
|
|
@@ -44,7 +44,7 @@ export async function loader(args: Route.LoaderArgs) {
|
|
|
44
44
|
// Your code here
|
|
45
45
|
}
|
|
46
46
|
`);
|
|
47
|
-
|
|
47
|
+
const invalidRootLoaderCallbackReturn = createErrorMessage(`
|
|
48
48
|
You're returning an invalid response from the 'rootAuthLoader' inside root.tsx.
|
|
49
49
|
You can only return plain objects, Responses created using the React Router 'data()'helper or
|
|
50
50
|
custom redirect 'Response' instances (status codes in the range of 300 to 400).
|
|
@@ -67,18 +67,16 @@ export async function loader(args: Route.LoaderArgs) {
|
|
|
67
67
|
})
|
|
68
68
|
}
|
|
69
69
|
`);
|
|
70
|
-
|
|
70
|
+
const noSecretKeyError = createErrorMessage(`
|
|
71
71
|
A secretKey must be provided in order to use SSR and the exports from @clerk/react-router/api.');
|
|
72
72
|
If your runtime supports environment variables, you can add a CLERK_SECRET_KEY variable to your config.
|
|
73
73
|
Otherwise, you can pass a secretKey parameter to rootAuthLoader or getAuth.
|
|
74
74
|
`);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
);
|
|
78
|
-
var satelliteAndMissingSignInUrl = createErrorMessage(`
|
|
75
|
+
const satelliteAndMissingProxyUrlAndDomain = createErrorMessage(`Missing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl`);
|
|
76
|
+
const satelliteAndMissingSignInUrl = createErrorMessage(`
|
|
79
77
|
Invalid signInUrl. A satellite application requires a signInUrl for development instances.
|
|
80
78
|
Check if signInUrl is missing from your configuration or if it is not an absolute URL.`);
|
|
81
|
-
|
|
79
|
+
const publishableKeyMissingErrorInSpaMode = createErrorMessage(`
|
|
82
80
|
You're trying to use Clerk in React Router SPA Mode without providing a Publishable Key.
|
|
83
81
|
Please provide the publishableKey prop on the <ClerkProvider> component.
|
|
84
82
|
|
|
@@ -86,14 +84,7 @@ Example:
|
|
|
86
84
|
|
|
87
85
|
<ClerkProvider publishableKey={PUBLISHABLE_KEY}>
|
|
88
86
|
`);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
noClerkStateError,
|
|
93
|
-
noLoaderArgsPassedInGetAuth,
|
|
94
|
-
noSecretKeyError,
|
|
95
|
-
publishableKeyMissingErrorInSpaMode,
|
|
96
|
-
satelliteAndMissingProxyUrlAndDomain,
|
|
97
|
-
satelliteAndMissingSignInUrl
|
|
98
|
-
};
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
export { invalidClerkStatePropError, invalidRootLoaderCallbackReturn, noClerkStateError, noLoaderArgsPassedInGetAuth, noSecretKeyError, publishableKeyMissingErrorInSpaMode, satelliteAndMissingProxyUrlAndDomain, satelliteAndMissingSignInUrl };
|
|
99
90
|
//# sourceMappingURL=errors.js.map
|
package/dist/utils/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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\nconst ssrExample = `Use 'rootAuthLoader' as your root loader. Then, add <ClerkProvider> to your app.\nExample:\n\nimport { rootAuthLoader } from '@clerk/react-router/ssr.server'\nimport { ClerkProvider } from '@clerk/react-router'\n\nexport async function loader(args: Route.LoaderArgs) {\n return rootAuthLoader(args)\n}\n\nexport default function App({ loaderData }: Route.ComponentProps) {\n return (\n <ClerkProvider loaderData={loaderData}>\n <Outlet />\n </ClerkProvider>\n )\n}\n`;\n\nexport const invalidClerkStatePropError = createErrorMessage(`\nYou're trying to pass an invalid object in \"<ClerkProvider clerkState={...}>\".\n\n${ssrExample}\n`);\n\nexport const noClerkStateError = createErrorMessage(`\nLooks like you didn't pass 'clerkState' to \"<ClerkProvider clerkState={...}>\".\n\n${ssrExample}\n`);\n\nexport const noLoaderArgsPassedInGetAuth = createErrorMessage(`\nYou're calling 'getAuth()' from a loader, without providing the loader args object.\nExample:\n\nexport async function loader(args: Route.LoaderArgs) {\n const { userId } = await getAuth(args)\n\n // Your code here\n}\n`);\n\nexport const invalidRootLoaderCallbackReturn = createErrorMessage(`\nYou're returning an invalid response from the 'rootAuthLoader' inside root.tsx.\nYou can only return plain objects, Responses created using the React Router 'data()'helper or\ncustom redirect 'Response' instances (status codes in the range of 300 to 400).\nIf you want to return a primitive value or an array, you can always wrap the response with an object.\n\nExample:\n\nexport async function loader(args: Route.LoaderArgs) {\n return rootAuthLoader(args, async ({ auth }) => {\n const { userId } = auth;\n const posts = await database.getPostsByUserId(userId);\n\n return { data: posts }\n // Or\n return data(posts, {\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n })\n}\n`);\n\nexport const noSecretKeyError = createErrorMessage(`\nA secretKey must be provided in order to use SSR and the exports from @clerk/react-router/api.');\nIf your runtime supports environment variables, you can add a CLERK_SECRET_KEY variable to your config.\nOtherwise, you can pass a secretKey parameter to rootAuthLoader or getAuth.\n`);\n\nexport const satelliteAndMissingProxyUrlAndDomain = createErrorMessage(\n `Missing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl`,\n);\n\nexport const satelliteAndMissingSignInUrl = createErrorMessage(`\nInvalid signInUrl. A satellite application requires a signInUrl for development instances.\nCheck if signInUrl is missing from your configuration or if it is not an absolute URL.`);\n\nexport const publishableKeyMissingErrorInSpaMode = createErrorMessage(`\nYou're trying to use Clerk in React Router SPA Mode without providing a Publishable Key.\nPlease provide the publishableKey prop on the <ClerkProvider> component.\n\nExample:\n\n<ClerkProvider publishableKey={PUBLISHABLE_KEY}>\n`);\n"],"mappings":";AAAA,
|
|
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\nconst ssrExample = `Use 'rootAuthLoader' as your root loader. Then, add <ClerkProvider> to your app.\nExample:\n\nimport { rootAuthLoader } from '@clerk/react-router/ssr.server'\nimport { ClerkProvider } from '@clerk/react-router'\n\nexport async function loader(args: Route.LoaderArgs) {\n return rootAuthLoader(args)\n}\n\nexport default function App({ loaderData }: Route.ComponentProps) {\n return (\n <ClerkProvider loaderData={loaderData}>\n <Outlet />\n </ClerkProvider>\n )\n}\n`;\n\nexport const invalidClerkStatePropError = createErrorMessage(`\nYou're trying to pass an invalid object in \"<ClerkProvider clerkState={...}>\".\n\n${ssrExample}\n`);\n\nexport const noClerkStateError = createErrorMessage(`\nLooks like you didn't pass 'clerkState' to \"<ClerkProvider clerkState={...}>\".\n\n${ssrExample}\n`);\n\nexport const noLoaderArgsPassedInGetAuth = createErrorMessage(`\nYou're calling 'getAuth()' from a loader, without providing the loader args object.\nExample:\n\nexport async function loader(args: Route.LoaderArgs) {\n const { userId } = await getAuth(args)\n\n // Your code here\n}\n`);\n\nexport const invalidRootLoaderCallbackReturn = createErrorMessage(`\nYou're returning an invalid response from the 'rootAuthLoader' inside root.tsx.\nYou can only return plain objects, Responses created using the React Router 'data()'helper or\ncustom redirect 'Response' instances (status codes in the range of 300 to 400).\nIf you want to return a primitive value or an array, you can always wrap the response with an object.\n\nExample:\n\nexport async function loader(args: Route.LoaderArgs) {\n return rootAuthLoader(args, async ({ auth }) => {\n const { userId } = auth;\n const posts = await database.getPostsByUserId(userId);\n\n return { data: posts }\n // Or\n return data(posts, {\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n })\n}\n`);\n\nexport const noSecretKeyError = createErrorMessage(`\nA secretKey must be provided in order to use SSR and the exports from @clerk/react-router/api.');\nIf your runtime supports environment variables, you can add a CLERK_SECRET_KEY variable to your config.\nOtherwise, you can pass a secretKey parameter to rootAuthLoader or getAuth.\n`);\n\nexport const satelliteAndMissingProxyUrlAndDomain = createErrorMessage(\n `Missing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl`,\n);\n\nexport const satelliteAndMissingSignInUrl = createErrorMessage(`\nInvalid signInUrl. A satellite application requires a signInUrl for development instances.\nCheck if signInUrl is missing from your configuration or if it is not an absolute URL.`);\n\nexport const publishableKeyMissingErrorInSpaMode = createErrorMessage(`\nYou're trying to use Clerk in React Router SPA Mode without providing a Publishable Key.\nPlease provide the publishableKey prop on the <ClerkProvider> component.\n\nExample:\n\n<ClerkProvider publishableKey={PUBLISHABLE_KEY}>\n`);\n"],"mappings":";AAAA,MAAM,sBAAsB,QAAgB;CAC1C,OAAO,aAAa,IAAI,KAAK,EAAE;;;;;AAKjC;AAEA,MAAM,aAAa;;;;;;;;;;;;;;;;;;AAmBnB,MAAa,6BAA6B,mBAAmB;;;EAG3D,WAAW;CACZ;AAED,MAAa,oBAAoB,mBAAmB;;;EAGlD,WAAW;CACZ;AAED,MAAa,8BAA8B,mBAAmB;;;;;;;;;CAS7D;AAED,MAAa,kCAAkC,mBAAmB;;;;;;;;;;;;;;;;;;;;;;CAsBjE;AAED,MAAa,mBAAmB,mBAAmB;;;;CAIlD;AAED,MAAa,uCAAuC,mBAClD,8FACF;AAEA,MAAa,+BAA+B,mBAAmB;;uFAEwB;AAEvF,MAAa,sCAAsC,mBAAmB;;;;;;;CAOrE"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// src/utils/feature-flags.ts
|
|
2
1
|
import { getEnvVariable } from "@clerk/shared/getEnvVariable";
|
|
3
2
|
import { isTruthy } from "@clerk/shared/underscore";
|
|
4
3
|
import { isAutomatedEnvironment, isDevelopmentEnvironment } from "@clerk/shared/utils";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/utils/feature-flags.ts
|
|
6
|
+
const KEYLESS_DISABLED = isTruthy(getEnvVariable("VITE_CLERK_KEYLESS_DISABLED")) || isTruthy(getEnvVariable("CLERK_KEYLESS_DISABLED")) || false;
|
|
7
|
+
const canUseKeyless = isDevelopmentEnvironment() && !isAutomatedEnvironment() && !KEYLESS_DISABLED;
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { canUseKeyless };
|
|
10
11
|
//# sourceMappingURL=feature-flags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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\nconst KEYLESS_DISABLED =\n isTruthy(getEnvVariable('VITE_CLERK_KEYLESS_DISABLED')) ||\n isTruthy(getEnvVariable('CLERK_KEYLESS_DISABLED')) ||\n false;\n\nexport const canUseKeyless = isDevelopmentEnvironment() && !isAutomatedEnvironment() && !KEYLESS_DISABLED;\n"],"mappings":"
|
|
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\nconst KEYLESS_DISABLED =\n isTruthy(getEnvVariable('VITE_CLERK_KEYLESS_DISABLED')) ||\n isTruthy(getEnvVariable('CLERK_KEYLESS_DISABLED')) ||\n false;\n\nexport const canUseKeyless = isDevelopmentEnvironment() && !isAutomatedEnvironment() && !KEYLESS_DISABLED;\n"],"mappings":";;;;;AAIA,MAAM,mBACJ,SAAS,eAAe,6BAA6B,CAAC,KACtD,SAAS,eAAe,wBAAwB,CAAC,KACjD;AAEF,MAAa,gBAAgB,yBAAyB,KAAK,CAAC,uBAAuB,KAAK,CAAC"}
|
package/dist/webhooks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "@clerk/backend/webhooks";
|
package/dist/webhooks.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "@clerk/backend/webhooks"
|
|
2
|
+
|
|
3
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/react-router",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2-canary.v20260610190754",
|
|
4
4
|
"description": "Clerk SDK for React Router",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clerk",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"cookie": "1.0.2",
|
|
89
89
|
"tslib": "2.8.1",
|
|
90
|
-
"@clerk/
|
|
91
|
-
"@clerk/
|
|
92
|
-
"@clerk/
|
|
90
|
+
"@clerk/react": "6.9.1-canary.v20260610190754",
|
|
91
|
+
"@clerk/shared": "4.17.1-canary.v20260610190754",
|
|
92
|
+
"@clerk/backend": "3.6.2-canary.v20260610190754"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"esbuild-plugin-file-path-extensions": "^2.1.4",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"access": "public"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
|
-
"build": "
|
|
111
|
-
"dev": "
|
|
110
|
+
"build": "tsdown",
|
|
111
|
+
"dev": "tsdown --watch",
|
|
112
112
|
"dev:pub": "pnpm dev -- --env.publish",
|
|
113
113
|
"format": "node ../../scripts/format-package.mjs",
|
|
114
114
|
"format:check": "node ../../scripts/format-package.mjs --check",
|
package/dist/api/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/index.ts"],"sourcesContent":["export * from '@clerk/backend';\n"],"mappings":";AAAA,cAAc;","names":[]}
|
package/dist/client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/index.ts"],"sourcesContent":["export * from './ReactRouterClerkProvider';\nexport type { WithClerkState } from './types';\nexport { SignIn, SignUp, OrganizationProfile, UserProfile } from './uiComponents';\nexport { UNSAFE_PortalProvider } from '@clerk/react';\n"],"mappings":";AAAA,cAAc;AAEd,SAAS,QAAQ,QAAQ,qBAAqB,mBAAmB;AACjE,SAAS,6BAA6B;","names":[]}
|
package/dist/client/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["export {\n ClerkAPIResponseError,\n ClerkOfflineError,\n ClerkRuntimeError,\n isClerkAPIResponseError,\n isClerkRuntimeError,\n isEmailLinkError,\n isKnownError,\n isMetamaskError,\n isReverificationCancelledError,\n EmailLinkErrorCode,\n EmailLinkErrorCodeStatus,\n} from '@clerk/react/errors';\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
package/dist/global.d.d.ts
DELETED
package/dist/global.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=global.d.js.map
|
package/dist/global.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|