Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Jan 9, 2026

Summary

This PR consolidates the UI module configuration into a single ui prop on ClerkProvider that accepts either:

  • The version export from @clerk/ui for hot loading with version pinning
  • The ClerkUI class constructor from @clerk/ui for direct module usage (bundled with your app)

Usage Examples

// Hot loading with version pinning
import { version } from '@clerk/ui';
<ClerkProvider ui={version} />

// Direct module usage (bundled with your app)
import { ClerkUI } from '@clerk/ui';
<ClerkProvider ui={ClerkUI} />

Runtime Validation

Only legitimate exports from @clerk/ui are accepted. The exports are branded with a symbol (Symbol.for('clerk:ui')) that is validated at runtime. This means:

  • import { version } from '@clerk/ui' - accepted
  • import { ClerkUI } from '@clerk/ui' - accepted
  • { version: "1.0.0" } - rejected (arbitrary object)
  • "1.0.0" - rejected (string)

Changes

  • Split Ui type into UiVersion and UiModule, with Ui as a union of both
  • Export version object and ClerkUI constructor from @clerk/ui
  • Add UI_BRAND_SYMBOL for runtime validation of legitimate exports
  • Update IsomorphicClerk to detect and validate both ui types
  • Update IsomorphicClerkOptions.ui to accept both types
  • Keep clerkUiCtor as internal property for clerk.load() compatibility
  • Update @clerk/astro, @clerk/vue, @clerk/chrome-extension to use new pattern

Test plan

  • Build passes for all affected packages
  • Tests pass for @clerk/react and @clerk/shared
  • Manual testing with both version pinning and direct module usage

Summary by CodeRabbit

  • New Features

    • Unified ui prop across integrations to accept either a version object (hot-loading) or a bundled ClerkUI module.
  • Updates

    • UI package now exports both a version object and a ClerkUI module; integrations (React, Astro, Vue, Next, Chrome extension) load either form and prefer provided version/url when available.
    • Chrome extension provider simplified to a concrete UI module prop surface.
  • Documentation

    • Added examples and JSDoc for hot-loading, direct usage, and runtime validation of UI exports.

✏️ Tip: You can customize this high-level summary in your review settings.

…structor

This change consolidates the UI module configuration into a single `ui` prop
that accepts either:
- A version object (`ui` export from @clerk/ui) for hot loading with version pinning
- The ClerkUI class constructor (`ClerkUI` export from @clerk/ui) for direct module usage

Changes:
- Split Ui type into UiVersion and UiModule, with Ui as a union of both
- Export ClerkUI constructor from @clerk/ui for direct bundling usage
- Update IsomorphicClerk to detect and handle both ui types
- Update IsomorphicClerkOptions.ui to accept both types
- Keep clerkUiCtor as internal property for clerk.load() compatibility
- Update @clerk/astro, @clerk/vue, @clerk/chrome-extension to use new pattern
@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

🦋 Changeset detected

Latest commit: 4cccd8d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@clerk/astro Minor
@clerk/chrome-extension Minor
@clerk/nextjs Minor
@clerk/react Minor
@clerk/shared Minor
@clerk/ui Minor
@clerk/vue Minor
@clerk/expo Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/agent-toolkit Patch
@clerk/backend Patch
@clerk/clerk-js Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/nuxt Patch
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 10, 2026 4:00am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

The PR introduces a unified ui option that accepts either a branded UiVersion ({ __brand, version, url? }) or a UiModule constructor (ClerkUI). It adds UI_BRAND_SYMBOL plus runtime/type guards (isLegitimateUiExport, isUiConstructor, isUiVersion), changes Ui to a UiVersion | UiModule union, and updates loading to use a provided constructor or hot-load by version/url. Changes span packages: ui, shared, react, vue, astro, chrome-extension, nextjs, and related integrations.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main objective: unifying the ui prop to accept both the version object from @clerk/ui and the ClerkUI constructor, which is reflected throughout the substantial changes across multiple packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c1db0bb and 4cccd8d.

📒 Files selected for processing (1)
  • packages/ui/src/internal/index.ts
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/ui/src/internal/index.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/ui/src/internal/index.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/ui/src/internal/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/ui/src/internal/index.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/ui/src/internal/index.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/ui/src/internal/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/ui/src/internal/index.ts
**/index.ts

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

Avoid barrel files (index.ts re-exports) as they can cause circular dependencies

Files:

  • packages/ui/src/internal/index.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/ui/src/internal/index.ts
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • packages/ui/src/internal/index.ts
packages/ui/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-ui-theming.mdc)

packages/ui/src/**/*.{ts,tsx}: Use element descriptors for all themable elements by applying elementDescriptor prop to components and importing descriptors from packages/ui/src/customizables/elementDescriptors.ts
Use theme-aware functions in elements configuration to access design tokens (e.g., { theme } => ({ backgroundColor: theme.colors.$primary500 }))
Prefer CSS variables (e.g., --clerk-color-primary, --clerk-spacing) for runtime customization via the clerkCssVar utility
Automatically generate color scales using the color scale generation process rather than manually defining all lightness and alpha variations (25, 50, 100, 150, 200, 300, 400, 500, 600, 700, 750, 800, 850, 900, 950 shades)
Use the createVariants function from packages/ui/src/styledSystem/createVariants.ts for type-safe variant-based styling with base, variants, defaultVariants, and compoundVariants configuration
Wrap primitive components with makeCustomizable HOC from packages/ui/src/customizables/makeCustomizable.tsx to enable element descriptor support and theming
Apply the sx prop using either a theme-aware function (theme: InternalTheme) => StyleRule or static style object to components for theme-aware CSS
Use state props (isLoading, hasError, isOpen, isActive) to automatically generate state classes (cl-loading, cl-error, cl-open, cl-active) for styling
Use CSS light-dark() function via the lightDark utility from packages/ui/src/utils/lightDark.ts for automatic light/dark mode support with fallbacks
Use Emotion's css prop and ThemeProvider via InternalThemeProvider from packages/ui/src/styledSystem/InternalThemeProvider.tsx for styling and theme context
Use makeResponsive from packages/ui/src/customizables/makeResponsive.tsx with breakpoints defined in packages/ui/src/styledSystem/breakpoints.tsx for responsive design support
Use useDeepEqualMemo in AppearanceProvider to prevent unnecessary re-renders when appearance configuration changes

Files:

  • packages/ui/src/internal/index.ts
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/ui/src/internal/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (6)
packages/ui/src/internal/index.ts (6)

6-16: LGTM!

The unknown extends A pattern correctly identifies when A is any or unknown, ensuring proper fallback to the Default type. This is a well-known TypeScript idiom for detecting unconstrained type parameters.


18-23: LGTM!

Using Symbol.for() with a namespaced key ensures the same symbol is used across module boundaries, which is essential for the runtime branding validation to work correctly.


25-43: LGTM!

The type is well-structured with proper use of unknown as the default generic parameter (per coding guidelines), and the phantom property pattern for type-level appearance inference is correctly documented.


45-70: LGTM!

The type correctly models a branded class constructor. Using unknown for constructor arguments and instance type follows TypeScript best practices for safer type handling.


72-79: LGTM!

The union type cleanly represents both UI configuration patterns (version pinning vs direct module usage) as intended by the PR.


132-141: LGTM!

The testing constant correctly uses Symbol.for(UI_BRAND_SYMBOL_KEY) for consistent branding across module boundaries. The @internal marker and warning comment appropriately indicate this is not for production use.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/astro/src/internal/create-clerk-instance.ts (1)

123-138: Pass clerkUiVersion and clerkUiUrl extracted from the ui object, matching the React implementation.

The loadClerkUiScript function expects clerkUiVersion and clerkUiUrl properties (as defined in LoadClerkUiScriptOptions), but this code passes the entire options object. When ui is an object with version and url properties, those values are ignored because the clerkUiScriptUrl function only reads clerkUiUrl and clerkUiVersion properties—it has no knowledge of the ui object structure.

Extract these values before calling loadClerkUiScript:

const uiVersion = typeof options?.ui === 'object' ? options.ui : undefined;

await loadClerkUiScript({
  ...options,
  clerkUiVersion: uiVersion?.version,
  clerkUiUrl: uiVersion?.url || options?.clerkUiUrl,
});
🧹 Nitpick comments (2)
packages/react/src/isomorphicClerk.ts (1)

511-517: Duplicate type guard - consider extracting to @clerk/shared.

This isUiConstructor function is duplicated in packages/astro/src/internal/create-clerk-instance.ts (lines 115-117). To maintain DRY and ensure consistent behavior across packages, consider moving this to @clerk/shared/ui alongside the ClerkUiConstructor type.

packages/astro/src/internal/create-clerk-instance.ts (1)

111-117: Duplicate function - same implementation exists in @clerk/react.

This is identical to isUiConstructor in packages/react/src/isomorphicClerk.ts. Consider extracting to @clerk/shared/ui to avoid divergence.

📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between faaeada and 5b18287.

📒 Files selected for processing (10)
  • integration/templates/express-vite/src/client/main.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/astro/src/types.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/react/src/isomorphicClerk.ts
  • packages/react/src/types.ts
  • packages/shared/src/types/clerk.ts
  • packages/ui/src/index.ts
  • packages/ui/src/internal/index.ts
  • packages/vue/src/plugin.ts
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/astro/src/types.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/astro/src/types.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/astro/src/types.ts
  • integration/templates/express-vite/src/client/main.ts
  • packages/react/src/types.ts
  • packages/astro/src/internal/create-clerk-instance.ts
  • packages/shared/src/types/clerk.ts
  • packages/vue/src/plugin.ts
  • packages/react/src/isomorphicClerk.ts
  • packages/ui/src/index.ts
  • packages/chrome-extension/src/react/ClerkProvider.tsx
  • packages/ui/src/internal/index.ts
**/index.ts

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

Avoid barrel files (index.ts re-exports) as they can cause circular dependencies

Files:

  • packages/ui/src/index.ts
  • packages/ui/src/internal/index.ts
packages/ui/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-ui-theming.mdc)

packages/ui/src/**/*.{ts,tsx}: Use element descriptors for all themable elements by applying elementDescriptor prop to components and importing descriptors from packages/ui/src/customizables/elementDescriptors.ts
Use theme-aware functions in elements configuration to access design tokens (e.g., { theme } => ({ backgroundColor: theme.colors.$primary500 }))
Prefer CSS variables (e.g., --clerk-color-primary, --clerk-spacing) for runtime customization via the clerkCssVar utility
Automatically generate color scales using the color scale generation process rather than manually defining all lightness and alpha variations (25, 50, 100, 150, 200, 300, 400, 500, 600, 700, 750, 800, 850, 900, 950 shades)
Use the createVariants function from packages/ui/src/styledSystem/createVariants.ts for type-safe variant-based styling with base, variants, defaultVariants, and compoundVariants configuration
Wrap primitive components with makeCustomizable HOC from packages/ui/src/customizables/makeCustomizable.tsx to enable element descriptor support and theming
Apply the sx prop using either a theme-aware function (theme: InternalTheme) => StyleRule or static style object to components for theme-aware CSS
Use state props (isLoading, hasError, isOpen, isActive) to automatically generate state classes (cl-loading, cl-error, cl-open, cl-active) for styling
Use CSS light-dark() function via the lightDark utility from packages/ui/src/utils/lightDark.ts for automatic light/dark mode support with fallbacks
Use Emotion's css prop and ThemeProvider via InternalThemeProvider from packages/ui/src/styledSystem/InternalThemeProvider.tsx for styling and theme context
Use makeResponsive from packages/ui/src/customizables/makeResponsive.tsx with breakpoints defined in packages/ui/src/styledSystem/breakpoints.tsx for responsive design support
Use useDeepEqualMemo in AppearanceProvider to prevent unnecessary re-renders when appearance configuration changes

Files:

  • packages/ui/src/index.ts
  • packages/ui/src/internal/index.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components

Files:

  • packages/chrome-extension/src/react/ClerkProvider.tsx
**/*.{md,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Update documentation for API changes

Files:

  • packages/chrome-extension/src/react/ClerkProvider.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., UserProfile, NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/chrome-extension/src/react/ClerkProvider.tsx
🧬 Code graph analysis (7)
integration/templates/express-vite/src/client/main.ts (2)
packages/clerk-js/src/core/clerk.ts (2)
  • publishableKey (300-302)
  • Clerk (211-3120)
packages/ui/src/index.ts (1)
  • ClerkUI (22-22)
packages/astro/src/internal/create-clerk-instance.ts (4)
packages/react/src/isomorphicClerk.ts (2)
  • isUiConstructor (515-517)
  • getClerkUiEntryChunk (519-543)
packages/ui/src/index.ts (1)
  • ui (13-15)
packages/shared/src/ui/types.ts (1)
  • ClerkUiConstructor (33-41)
packages/ui/src/internal/index.ts (1)
  • Ui (68-68)
packages/shared/src/types/clerk.ts (1)
packages/shared/src/ui/types.ts (1)
  • ClerkUiConstructor (33-41)
packages/vue/src/plugin.ts (3)
packages/react/src/isomorphicClerk.ts (1)
  • isUiConstructor (515-517)
packages/ui/src/index.ts (1)
  • ui (13-15)
packages/shared/src/ui/types.ts (1)
  • ClerkUiConstructor (33-41)
packages/react/src/isomorphicClerk.ts (3)
packages/ui/src/index.ts (1)
  • ui (13-15)
packages/shared/src/ui/types.ts (1)
  • ClerkUiConstructor (33-41)
packages/shared/src/loadClerkJsScript.ts (1)
  • loadClerkUiScript (171-216)
packages/ui/src/index.ts (2)
packages/clerk-js/sandbox/public/mockServiceWorker.js (1)
  • PACKAGE_VERSION (9-9)
packages/ui/src/internal/index.ts (3)
  • UiVersion (26-37)
  • Appearance (72-72)
  • UiModule (44-61)
packages/chrome-extension/src/react/ClerkProvider.tsx (3)
packages/ui/src/internal/index.ts (2)
  • UiModule (44-61)
  • Appearance (72-72)
packages/react-router/src/client/ReactRouterClerkProvider.tsx (1)
  • ClerkProvider (126-148)
packages/ui/src/index.ts (1)
  • ClerkUI (22-22)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (5)
packages/react/src/isomorphicClerk.ts (1)

519-543: LGTM!

The logic correctly handles both UI configuration modes: direct constructor usage short-circuits to return immediately, while version-based configuration proceeds with script loading. The fallback to this.options.clerkUiUrl preserves backward compatibility.

packages/astro/src/types.ts (1)

39-44: LGTM!

The new ui property is well-documented with clear JSDoc explaining both usage modes (version object for hot loading vs. ClerkUI constructor for direct bundling).

packages/ui/src/index.ts (1)

17-22: LGTM - double assertion is justified for Tagged types.

The as unknown as UiModule<Appearance> assertion is necessary because ClerkUiClass doesn't directly satisfy the Tagged<..., 'ClerkUiModule'> branded type structure. The JSDoc clearly documents the purpose of this export.

packages/chrome-extension/src/react/ClerkProvider.tsx (2)

12-21: LGTM - appropriate simplification for Chrome extension context.

The comment clearly explains why UiModule<Appearance> is used instead of the generic Ui type. Omitting ui from the exposed props and hardcoding ClerkUI internally is the right approach since Chrome extensions always bundle the UI module.


37-46: LGTM!

The ui={ClerkUI} prop correctly uses the new unified ui prop pattern instead of the previous clerkUiCtor internal property.

- Rename `ui` export to `version` in @clerk/ui for clarity
- Add `UI_BRAND_SYMBOL` to validate legitimate @clerk/ui exports at runtime
- Update detection logic in react, astro, vue to check for brand symbol
- Only accept exports with the correct symbol, reject arbitrary objects
- Remove Tagged wrapper from UiVersion and UiModule types since
  symbol brand already provides sufficient runtime validation
- Fix clerk-script.tsx to properly access url property on version
  objects by checking type at runtime
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @packages/ui/src/internal/index.ts:
- Around line 47-65: The constructor signature on UiModule (new (...args:
any[]): any) uses unconstrained any; change it to a typed constructor by
replacing the args with unknown[] and the instance return with a generic
instance type (e.g., add a second generic like I and use new (...args:
unknown[]): I) so callers retain type safety; update UiModule's definition (and
any call sites) to supply or infer the instance type instead of relying on any
and avoid using any without justification.
📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cc701e4 and 894ab03.

📒 Files selected for processing (2)
  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
**/*.{md,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Update documentation for API changes

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., UserProfile, NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/nextjs/src/utils/clerk-script.tsx
  • packages/ui/src/internal/index.ts
**/index.ts

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

Avoid barrel files (index.ts re-exports) as they can cause circular dependencies

Files:

  • packages/ui/src/internal/index.ts
packages/ui/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-ui-theming.mdc)

packages/ui/src/**/*.{ts,tsx}: Use element descriptors for all themable elements by applying elementDescriptor prop to components and importing descriptors from packages/ui/src/customizables/elementDescriptors.ts
Use theme-aware functions in elements configuration to access design tokens (e.g., { theme } => ({ backgroundColor: theme.colors.$primary500 }))
Prefer CSS variables (e.g., --clerk-color-primary, --clerk-spacing) for runtime customization via the clerkCssVar utility
Automatically generate color scales using the color scale generation process rather than manually defining all lightness and alpha variations (25, 50, 100, 150, 200, 300, 400, 500, 600, 700, 750, 800, 850, 900, 950 shades)
Use the createVariants function from packages/ui/src/styledSystem/createVariants.ts for type-safe variant-based styling with base, variants, defaultVariants, and compoundVariants configuration
Wrap primitive components with makeCustomizable HOC from packages/ui/src/customizables/makeCustomizable.tsx to enable element descriptor support and theming
Apply the sx prop using either a theme-aware function (theme: InternalTheme) => StyleRule or static style object to components for theme-aware CSS
Use state props (isLoading, hasError, isOpen, isActive) to automatically generate state classes (cl-loading, cl-error, cl-open, cl-active) for styling
Use CSS light-dark() function via the lightDark utility from packages/ui/src/utils/lightDark.ts for automatic light/dark mode support with fallbacks
Use Emotion's css prop and ThemeProvider via InternalThemeProvider from packages/ui/src/styledSystem/InternalThemeProvider.tsx for styling and theme context
Use makeResponsive from packages/ui/src/customizables/makeResponsive.tsx with breakpoints defined in packages/ui/src/styledSystem/breakpoints.tsx for responsive design support
Use useDeepEqualMemo in AppearanceProvider to prevent unnecessary re-renders when appearance configuration changes

Files:

  • packages/ui/src/internal/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
  • GitHub Check: Unit Tests (**)
  • GitHub Check: Unit Tests (shared, clerk-js, RQ)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
packages/ui/src/internal/index.ts (1)

130-134: No issues found. PACKAGE_VERSION is properly declared as a global ambient constant in TypeScript type declaration files and injected by the build configuration.

Likely an incorrect or invalid review comment.

packages/nextjs/src/utils/clerk-script.tsx (1)

53-66: Verify ui.url is guaranteed to be a string (or add a local guard) before passing into URL builders.

The new narrowing correctly avoids reading .url from constructors. One remaining sharp edge: 'url' in ui doesn’t ensure ui.url is a string—if upstream validation ever regresses, clerkUiScriptUrl(opts) / attribute builders could throw.

Optional local hardening (if upstream doesn’t fully guarantee types)
-  const uiVersionUrl = ui && typeof ui === 'object' && 'url' in ui ? ui.url : undefined;
+  const uiVersionUrl =
+    ui && typeof ui === 'object' && 'url' in ui && typeof (ui as any).url === 'string'
+      ? (ui as any).url
+      : undefined;

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 10, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7578

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7578

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7578

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7578

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7578

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7578

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7578

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7578

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7578

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7578

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7578

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7578

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7578

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7578

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7578

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7578

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7578

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7578

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7578

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7578

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7578

commit: 4cccd8d

- Change UiModule constructor args from any[] to unknown[]
- Add instance type generic parameter I to UiModule (defaults to unknown)
- Change appearance type defaults from any to unknown for type safety
- Add @typeparam JSDoc annotations
Update the type check to use 'unknown extends A' which correctly
handles both 'any' and 'unknown' type parameters, falling back
to the Default type in both cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants