@@ -21,7 +21,9 @@ function createIntegration<Params extends HotloadAstroClerkIntegrationParams>()
2121 // These are not provided when the "bundled" integration is used
2222 const clerkJSUrl = ( params as any ) ?. clerkJSUrl as string | undefined ;
2323 const clerkJSVersion = ( params as any ) ?. clerkJSVersion as string | undefined ;
24+ const clerkUIVersion = ( params as any ) ?. clerkUIVersion as string | undefined ;
2425 const prefetchUI = ( params as any ) ?. prefetchUI as boolean | undefined ;
26+ const hasUI = ! ! ( params as any ) ?. ui ;
2527
2628 return {
2729 name : '@clerk/astro/integration' ,
@@ -57,7 +59,11 @@ function createIntegration<Params extends HotloadAstroClerkIntegrationParams>()
5759 ...buildEnvVarFromOption ( domain , 'PUBLIC_CLERK_DOMAIN' ) ,
5860 ...buildEnvVarFromOption ( clerkJSUrl , 'PUBLIC_CLERK_JS_URL' ) ,
5961 ...buildEnvVarFromOption ( clerkJSVersion , 'PUBLIC_CLERK_JS_VERSION' ) ,
60- ...buildEnvVarFromOption ( prefetchUI === false ? 'false' : undefined , 'PUBLIC_CLERK_PREFETCH_UI' ) ,
62+ ...buildEnvVarFromOption ( clerkUIVersion , 'PUBLIC_CLERK_UI_VERSION' ) ,
63+ ...buildEnvVarFromOption (
64+ prefetchUI === false || hasUI ? 'false' : undefined ,
65+ 'PUBLIC_CLERK_PREFETCH_UI' ,
66+ ) ,
6167 } ,
6268
6369 ssr : {
@@ -165,6 +171,7 @@ function createClerkEnvSchema() {
165171 PUBLIC_CLERK_DOMAIN : envField . string ( { context : 'client' , access : 'public' , optional : true , url : true } ) ,
166172 PUBLIC_CLERK_JS_URL : envField . string ( { context : 'client' , access : 'public' , optional : true , url : true } ) ,
167173 PUBLIC_CLERK_JS_VERSION : envField . string ( { context : 'client' , access : 'public' , optional : true } ) ,
174+ PUBLIC_CLERK_UI_VERSION : envField . string ( { context : 'client' , access : 'public' , optional : true } ) ,
168175 PUBLIC_CLERK_PREFETCH_UI : envField . string ( { context : 'client' , access : 'public' , optional : true } ) ,
169176 PUBLIC_CLERK_UI_URL : envField . string ( { context : 'client' , access : 'public' , optional : true , url : true } ) ,
170177 PUBLIC_CLERK_TELEMETRY_DISABLED : envField . boolean ( { context : 'client' , access : 'public' , optional : true } ) ,
0 commit comments