Skip to content

Commit 2803a6e

Browse files
committed
fix(astro): support bundled UI via ui prop in getClerkUIEntryChunk
Add ui.ClerkUI check to match React and Vue implementations. Also add the ui prop to AstroClerkIntegrationParams type.
1 parent 41bc6f4 commit 2803a6e

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

packages/astro/src/internal/create-clerk-instance.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ async function getClerkUIEntryChunk<TUi extends Ui = Ui>(
121121
return options.clerkUICtor;
122122
}
123123

124+
// Support bundled UI via ui.ClerkUI prop
125+
if (options?.ui?.ClerkUI) {
126+
return options.ui.ClerkUI;
127+
}
128+
124129
if (options?.prefetchUI === false) {
125130
return undefined;
126131
}

packages/astro/src/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ type AstroClerkIntegrationParams<TUi extends Ui = Ui> = Without<
4141
* - `undefined` (default) - Prefetch UI normally
4242
*/
4343
prefetchUI?: boolean;
44+
/**
45+
* Optional object to use the bundled Clerk UI instead of loading from CDN.
46+
* Import `ui` from `@clerk/ui` and pass it here to bundle the UI with your application.
47+
* When omitted, UI is loaded from Clerk's CDN.
48+
*/
49+
ui?: TUi;
4450
};
4551

4652
type AstroClerkCreateInstanceParams<TUi extends Ui = Ui> = AstroClerkIntegrationParams<TUi> & {

0 commit comments

Comments
 (0)