Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Jan 30, 2026

Summary

  • Adds backwards compatibility for the clerkUiCtor option (lowercase "i") in clerk-js
  • The correct property name is clerkUICtor (uppercase "UI"), but some SDKs may still be passing the lowercase version
  • The fix normalizes the option in #initOptions so both casing variants work

Test plan

  • Verify clerk-js works when SDK passes clerkUICtor
  • Verify clerk-js works when SDK passes clerkUiCtor

Summary by CodeRabbit

  • Bug Fixes

    • Restored backwards-compatible support for the UI constructor option so both legacy and current option names work without configuration changes.
  • Tests

    • Added tests verifying the compatibility behavior and precedence when both legacy and current option names are present.

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: f56bad1

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

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/expo 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 30, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Feb 1, 2026 1:00am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

This pull request adds backwards compatibility support to the clerk/clerk-js package. Initialization now accepts both clerkUICtor and the legacy clerkUiCtor option names, normalizing to clerkUICtor during setup. Tests verify that clerkUICtor takes precedence when both are provided and that clerkUiCtor is used when only the legacy name is present. A changeset entry documenting the update was added. The change is limited to init logic and test coverage, with no public API signature changes.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding backwards compatibility support for both clerkUICtor and clerkUiCtor option names in clerk-js.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 30, 2026

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: f56bad1

@jacekradko
Copy link
Member Author

!snapshot

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/clerk-js/src/core/clerk.ts`:
- Around line 3250-3259: Add unit tests to cover the backward-compatible alias
behavior introduced in the `#initOptions` function: write tests that instantiate
Clerk (or call Clerk.prototype.#initOptions via a public initialization helper)
passing options with clerkUICtor and separately with the legacy clerkUiCtor and
assert that the resulting configuration uses the same constructor value in
clerkUICtor; include tests for both merging with defaultOptions and for when
only the legacy key is provided to ensure createAllowedRedirectOrigins and other
returned properties are preserved. Ensure tests reference the public
initialization path that exercises `#initOptions` (e.g., new Clerk(...) or init
method) and assert equality of the effective clerkUICtor and other merged
fields.

@clerk-cookie
Copy link
Collaborator

Hey @jacekradko - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.2.9-snapshot.v20260130121458
@clerk/astro 3.0.0-snapshot.v20260130121458
@clerk/backend 3.0.0-snapshot.v20260130121458
@clerk/chrome-extension 3.0.0-snapshot.v20260130121458
@clerk/clerk-js 6.0.0-snapshot.v20260130121458
@clerk/dev-cli 1.0.0-snapshot.v20260130121458
@clerk/expo 3.0.0-snapshot.v20260130121458
@clerk/expo-passkeys 1.0.0-snapshot.v20260130121458
@clerk/express 2.0.0-snapshot.v20260130121458
@clerk/fastify 2.7.0-snapshot.v20260130121458
@clerk/localizations 4.0.0-snapshot.v20260130121458
@clerk/msw 0.0.1-snapshot.v20260130121458
@clerk/nextjs 7.0.0-snapshot.v20260130121458
@clerk/nuxt 2.0.0-snapshot.v20260130121458
@clerk/react 6.0.0-snapshot.v20260130121458
@clerk/react-router 3.0.0-snapshot.v20260130121458
@clerk/shared 4.0.0-snapshot.v20260130121458
@clerk/tanstack-react-start 1.0.0-snapshot.v20260130121458
@clerk/testing 2.0.0-snapshot.v20260130121458
@clerk/ui 1.0.0-snapshot.v20260130121458
@clerk/upgrade 2.0.0-snapshot.v20260130121458
@clerk/vue 2.0.0-snapshot.v20260130121458

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/dev-cli

npm i @clerk/[email protected] --save-exact

@clerk/expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/msw

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/react

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/tanstack-react-start

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --save-exact

@clerk/ui

npm i @clerk/[email protected] --save-exact

@clerk/upgrade

npm i @clerk/[email protected] --save-exact

@clerk/vue

npm i @clerk/[email protected] --save-exact

@jacekradko jacekradko merged commit e79d078 into main Feb 1, 2026
40 checks passed
@jacekradko jacekradko deleted the jr/fix-clerk-ui-ctor-casing branch February 1, 2026 01:37
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.

4 participants