Skip to content

Conversation

@nikosdouvlis
Copy link
Member

@nikosdouvlis nikosdouvlis commented Jan 23, 2026

Why

The satellite configuration (isSatellite, domain, satelliteAutoSync) was scattered across top-level options in every SDK package. This made the API cluttered and it was unclear which options were related to multi-domain setups. Grouping them under a single multiDomain key makes the intent explicit and the options easier to discover.

What changed

  • Removed top-level isSatellite, domain, satelliteAutoSync from AuthenticateRequestOptions and ClerkOptions
  • Added multiDomain?: { isSatellite, domain?, proxyUrl?, autoSync? } key
  • proxyUrl stays top-level AND is allowed inside multiDomain (throws if both are set with conflicting values)
  • Renamed satelliteAutoSyncautoSync inside multiDomain
  • Added resolveProxyUrl utility in shared/src/multiDomain.ts
  • Updated all affected tests across packages

Packages affected

  • @clerk/shared: New types (MultiDomainConfig, MultiDomainAndOrProxy) and resolveProxyUrl utility
  • @clerk/backend: AuthenticateRequestOptions uses multiDomain, authenticateContext resolves nested values
  • @clerk/nextjs: Middleware and env merging use multiDomain
  • @clerk/astro: Middleware, integration, and env merging use multiDomain
  • @clerk/react-router: Middleware and load options use multiDomain
  • @clerk/tanstack-react-start: Load options and client utils use multiDomain
  • @clerk/clerk-js: isSatellite getter reads from options.multiDomain
  • @clerk/react: isomorphicClerk reads from options.multiDomain
  • @clerk/express: Passes multiDomain to authenticateRequest
  • @clerk/vue: Removed obsolete domain from Without type
  • @clerk/nuxt: Module and clerkClient use multiDomain

Summary by CodeRabbit

  • Refactor
    • Reorganized multi-domain and satellite configuration structure across SDKs for improved clarity and consistency. Configuration settings previously scattered across multiple options are now consolidated into a single multiDomain object, streamlining setup for multi-domain deployments.

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

Why:
The satellite configuration (isSatellite, domain, satelliteAutoSync) was spread
across top-level options, making the API confusing and cluttered. Grouping them
under a single `multiDomain` key makes the intent clearer and the options object
more organized.

What changed:
- Removed top-level `isSatellite`, `domain`, `satelliteAutoSync` from
  AuthenticateRequestOptions and ClerkOptions
- Added `multiDomain?: { isSatellite, domain?, proxyUrl?, autoSync? }` key
- `proxyUrl` stays top-level AND is allowed inside `multiDomain` (conflict
  detection if both are set with different values)
- Renamed `satelliteAutoSync` → `autoSync` inside multiDomain
- Added `resolveProxyUrl` utility in shared/src/multiDomain.ts
- Updated all SDK packages: backend, nextjs, astro, react-router,
  tanstack-react-start, clerk-js, react, vue, nuxt, express
- Updated all affected tests
@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2026

🦋 Changeset detected

Latest commit: 443cd01

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

This PR includes changesets to release 20 packages
Name Type
@clerk/shared Minor
@clerk/backend Minor
@clerk/nextjs Minor
@clerk/astro Minor
@clerk/react-router Minor
@clerk/tanstack-react-start Minor
@clerk/clerk-js Minor
@clerk/express Minor
@clerk/react Minor
@clerk/vue Minor
@clerk/nuxt Minor
@clerk/agent-toolkit Patch
@clerk/chrome-extension Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/testing Patch
@clerk/ui 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 23, 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 23, 2026 11:30am

Request Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 23, 2026

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 443cd01

@nikosdouvlis nikosdouvlis marked this pull request as draft January 23, 2026 11:34
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

This pull request restructures multi-domain and satellite configuration across the Clerk SDK by consolidating separate top-level properties—isSatellite, domain, satelliteAutoSync—into a nested multiDomain object containing { isSatellite, domain?, proxyUrl?, autoSync? }. The refactoring affects type definitions, configuration handling, and authentication workflows across multiple packages including Astro, Backend, Clerk JS, Express, Next.js, Nuxt, React Router, React, and TanStack React Start. A new resolveProxyUrl utility is introduced to manage proxy URL resolution with conflict detection, and new types MultiDomainConfig and MultiDomainConfigPrimitives are added to standardize the structure.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% 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 title accurately and concisely summarizes the main change: refactoring satellite configuration to be nested under a multiDomain key, which is the primary objective across all modified packages.

✏️ 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.

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: 2

🤖 Fix all issues with AI agents
In @.changeset/nest-multidomain-config.md:
- Around line 1-13: The changeset incorrectly marks breaking API removals as
minor—update the release type to MAJOR for all listed packages (the ones in the
diff: "@clerk/shared", "@clerk/backend", "@clerk/nextjs", "@clerk/astro",
"@clerk/react-router", "@clerk/tanstack-react-start", "@clerk/clerk-js",
"@clerk/express", "@clerk/react", "@clerk/vue", "@clerk/nuxt") because top-level
options isSatellite, domain, and satelliteAutoSync have been removed and moved
under multiDomain (the code and the HeadlessBrowserClerk interface no longer
accept those root-level fields), while proxyUrl remains at both levels; change
the changeset header from minor to major to reflect this breaking change.

In `@packages/astro/src/internal/merge-env-vars-with-params.ts`:
- Around line 23-34: The isSatellite boolean currently uses || which treats the
string "false" as truthy and overrides an explicit paramMultiDomain?.isSatellite
= false; change the logic in merge-env-vars-with-params.ts to use nullish
coalescing and parse the env value: compute isSatellite as
paramMultiDomain?.isSatellite ?? (import.meta.env.PUBLIC_CLERK_IS_SATELLITE ?
import.meta.env.PUBLIC_CLERK_IS_SATELLITE === "true" : undefined) (or
equivalent) so that explicit false from paramMultiDomain wins and the env string
is parsed to a real boolean before being used in the multiDomain object.

Comment on lines +1 to +13
---
"@clerk/shared": minor
"@clerk/backend": minor
"@clerk/nextjs": minor
"@clerk/astro": minor
"@clerk/react-router": minor
"@clerk/tanstack-react-start": minor
"@clerk/clerk-js": minor
"@clerk/express": minor
"@clerk/react": minor
"@clerk/vue": minor
"@clerk/nuxt": minor
---
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Search for usage of the old options across the codebase
rg --type=ts --type=js -i 'isSatellite|satelliteAutoSync' -A 2 -B 2 | head -100

Repository: clerk/javascript

Length of output: 7831


🏁 Script executed:

# Search for multiDomain usage to understand the new approach
rg --type=ts --type=js -i 'multiDomain' -A 2 -B 2 | head -100

Repository: clerk/javascript

Length of output: 7141


🏁 Script executed:

# Look for deprecation warnings or compatibility aliases
rg --type=ts --type=js -i 'deprecat|compat|alias' | grep -i -E '(isSatellite|satelliteAutoSync|domain|multiDomain)' | head -50

Repository: clerk/javascript

Length of output: 343


🏁 Script executed:

# Check the changeset file content to see full description
cat .changeset/nest-multidomain-config.md

Repository: clerk/javascript

Length of output: 632


🏁 Script executed:

# Search for any TypeScript type definitions or interfaces that might define these options
fd -e d.ts -e ts | xargs rg 'isSatellite|satelliteAutoSync|multiDomain' -B 3 -A 3 | head -150

Repository: clerk/javascript

Length of output: 12265


Correct version bump severity: this is a breaking change requiring MAJOR, not MINOR.

The changeset removes top-level isSatellite, domain, and satelliteAutoSync options—they are no longer accepted at the root configuration level and must be moved under multiDomain. This is an incompatible API change per semver. The HeadlessBrowserClerk interface explicitly excludes isSatellite, and the codebase reads values exclusively from multiDomain.* properties with no backward-compatibility aliases.

While proxyUrl remains available at both levels, the removal of the three other options breaks any existing code using them at the top level. All affected packages should be bumped to MAJOR, not MINOR.

🤖 Prompt for AI Agents
In @.changeset/nest-multidomain-config.md around lines 1 - 13, The changeset
incorrectly marks breaking API removals as minor—update the release type to
MAJOR for all listed packages (the ones in the diff: "@clerk/shared",
"@clerk/backend", "@clerk/nextjs", "@clerk/astro", "@clerk/react-router",
"@clerk/tanstack-react-start", "@clerk/clerk-js", "@clerk/express",
"@clerk/react", "@clerk/vue", "@clerk/nuxt") because top-level options
isSatellite, domain, and satelliteAutoSync have been removed and moved under
multiDomain (the code and the HeadlessBrowserClerk interface no longer accept
those root-level fields), while proxyUrl remains at both levels; change the
changeset header from minor to major to reflect this breaking change.

Comment on lines +23 to +34
const isSatellite = paramMultiDomain?.isSatellite || import.meta.env.PUBLIC_CLERK_IS_SATELLITE;
const domain = paramMultiDomain?.domain || import.meta.env.PUBLIC_CLERK_DOMAIN;

return {
signInUrl: paramSignIn || import.meta.env.PUBLIC_CLERK_SIGN_IN_URL,
signUpUrl: paramSignUp || import.meta.env.PUBLIC_CLERK_SIGN_UP_URL,
isSatellite: paramSatellite || import.meta.env.PUBLIC_CLERK_IS_SATELLITE,
multiDomain: isSatellite
? {
isSatellite: true as const,
...(domain ? { domain: domain as string } : {}),
}
: paramMultiDomain,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix boolean/env precedence for isSatellite.

Using || with PUBLIC_CLERK_IS_SATELLITE can treat "false" as truthy and also override an explicit multiDomain.isSatellite = false, which can incorrectly enable satellite mode. Prefer nullish coalescing and parse the env string.

Proposed fix
-  const isSatellite = paramMultiDomain?.isSatellite || import.meta.env.PUBLIC_CLERK_IS_SATELLITE;
-  const domain = paramMultiDomain?.domain || import.meta.env.PUBLIC_CLERK_DOMAIN;
+  const isSatellite =
+    paramMultiDomain?.isSatellite ?? isTruthy(import.meta.env.PUBLIC_CLERK_IS_SATELLITE);
+  const domain = paramMultiDomain?.domain ?? import.meta.env.PUBLIC_CLERK_DOMAIN;
🤖 Prompt for AI Agents
In `@packages/astro/src/internal/merge-env-vars-with-params.ts` around lines 23 -
34, The isSatellite boolean currently uses || which treats the string "false" as
truthy and overrides an explicit paramMultiDomain?.isSatellite = false; change
the logic in merge-env-vars-with-params.ts to use nullish coalescing and parse
the env value: compute isSatellite as paramMultiDomain?.isSatellite ??
(import.meta.env.PUBLIC_CLERK_IS_SATELLITE ?
import.meta.env.PUBLIC_CLERK_IS_SATELLITE === "true" : undefined) (or
equivalent) so that explicit false from paramMultiDomain wins and the env string
is parsed to a real boolean before being used in the multiDomain object.

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