-
Notifications
You must be signed in to change notification settings - Fork 466
Expand file tree
/
Copy pathtypes.ts
More file actions
53 lines (49 loc) · 2 KB
/
Copy pathtypes.ts
File metadata and controls
53 lines (49 loc) · 2 KB
1
2
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import type { VerifyTokenOptions } from '@clerk/backend';
import type { OrganizationSyncOptions } from '@clerk/backend/internal';
import type {
MultiDomainAndOrProxyPrimitives,
SignInFallbackRedirectUrl,
SignInForceRedirectUrl,
SignUpFallbackRedirectUrl,
SignUpForceRedirectUrl,
} from '@clerk/shared/types';
export type ClerkMiddlewareOptions = {
publishableKey?: string;
jwtKey?: string;
secretKey?: string;
machineSecretKey?: string;
signInUrl?: string;
signUpUrl?: string;
organizationSyncOptions?: OrganizationSyncOptions;
/**
* Controls whether satellite apps automatically sync with the primary domain on initial page load.
*
* When `false` (default), satellite apps will skip the automatic handshake if no session cookies exist,
* and only trigger the handshake after an explicit sign-in action. This provides the best performance
* by showing the satellite app immediately without attempting to sync state first.
*
* When `true`, satellite apps will automatically trigger a handshake redirect to sync authentication
* state with the primary domain on first load, even if no session cookies exist. Use this if you want
* users who are already signed in on the primary domain to be automatically recognized on the satellite.
*
* @default false
*/
satelliteAutoSync?: boolean;
} & Pick<VerifyTokenOptions, 'audience' | 'authorizedParties'> &
MultiDomainAndOrProxyPrimitives &
SignInForceRedirectUrl &
SignInFallbackRedirectUrl &
SignUpForceRedirectUrl &
SignUpFallbackRedirectUrl;
export type LoaderOptions = ClerkMiddlewareOptions;
/**
* Callback function that receives request context and returns middleware options.
* Allows dynamic configuration based on the current request.
*/
export type ClerkMiddlewareOptionsCallback = (args: {
url: URL;
}) => ClerkMiddlewareOptions | Promise<ClerkMiddlewareOptions>;
export type AdditionalStateOptions = SignInFallbackRedirectUrl &
SignUpFallbackRedirectUrl &
SignInForceRedirectUrl &
SignUpForceRedirectUrl;