File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
packages/nextjs/src/app-router Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { canUseKeyless } from '../../utils/feature-flags';
15
15
import { mergeNextClerkPropsWithEnv } from '../../utils/mergeNextClerkPropsWithEnv' ;
16
16
import { RouterTelemetry } from '../../utils/router-telemetry' ;
17
17
import { isNextWithUnstableServerActions } from '../../utils/sdk-versions' ;
18
+ import { detectKeylessEnvDriftAction } from '../keyless-actions' ;
18
19
import { invalidateCacheAction } from '../server-actions' ;
19
20
import { useAwaitablePush } from './useAwaitablePush' ;
20
21
import { useAwaitableReplace } from './useAwaitableReplace' ;
@@ -55,6 +56,11 @@ const NextClientClerkProvider = (props: NextClerkProviderProps) => {
55
56
}
56
57
} , [ isPending ] ) ;
57
58
59
+ // Call drift detection on mount (client-side)
60
+ useSafeLayoutEffect ( ( ) => {
61
+ void detectKeylessEnvDriftAction ( ) ;
62
+ } , [ ] ) ;
63
+
58
64
useSafeLayoutEffect ( ( ) => {
59
65
window . __unstable__onBeforeSetActive = intent => {
60
66
/**
Original file line number Diff line number Diff line change @@ -93,3 +93,12 @@ export async function deleteKeylessAction() {
93
93
await import ( '../server/keyless-node.js' ) . then ( m => m . removeKeyless ( ) ) . catch ( ( ) => { } ) ;
94
94
return ;
95
95
}
96
+
97
+ export async function detectKeylessEnvDriftAction ( ) {
98
+ try {
99
+ const { detectKeylessEnvDrift } = await import ( '../server/keyless-telemetry.js' ) ;
100
+ await detectKeylessEnvDrift ( ) ;
101
+ } catch {
102
+ // ignore
103
+ }
104
+ }
You can’t perform that action at this time.
0 commit comments