You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Controls whether a satellite app automatically syncs authentication state with the primary domain on first page load. When `false` (default), the satellite app skips the automatic redirect if no session cookies exist, and only triggers the handshake after the user initiates a sign-in or sign-up action. When `true`, the satellite app redirects to the primary domain on every first visit to sync state. Defaults to `false`. See [satellite domains](/docs/guides/dashboard/dns-domains/satellite-domains) for more details.
Copy file name to clipboardExpand all lines: docs/guides/dashboard/dns-domains/satellite-domains.mdx
+52-8Lines changed: 52 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,21 @@ Your "primary" domain is where the authentication state lives, and satellite dom
27
27
28
28
Users must complete both the sign-in and sign-up flows on the primary domain by using the [`<SignIn />`](/docs/reference/components/authentication/sign-in) component or [`useSignIn()`](/docs/reference/hooks/use-sign-in) hook for sign-in and [`<SignUp />`](/docs/reference/components/authentication/sign-up) component or [`useSignUp()`](/docs/reference/hooks/use-sign-up) hook for sign-up.
29
29
30
-
To access authentication state from a satellite domain, users will be transparently redirected to the primary domain. If users need to sign in, they must be redirected to a sign in flow hosted on the primary domain, then redirected back to the originating satellite domain. The same redirection process applies to sign-up flows.
30
+
### How authentication syncing works
31
+
32
+
> [!CAUTION]
33
+
> If you are upgrading from Core 2, see the [migration section](#migrating-from-core-2) for behavior changes that may affect your satellite applications.
34
+
35
+
The syncing behavior between satellite and primary domains is controlled by the `satelliteAutoSync` option.
36
+
37
+
With `satelliteAutoSync: false` (the default), satellite domains do not automatically sync authentication state with the primary domain when a user visits the page. This means there is no upfront performance cost for users visiting a satellite domain. Authentication state is only synced when a user initiates a sign-in or sign-up action:
38
+
39
+
1. When a user selects "Sign in" on the satellite domain, they are redirected to the primary domain.
40
+
1. If the user is already signed in on the primary domain, they are immediately redirected back to the satellite domain with the existing auth state — no additional user action is required.
41
+
1. If the user is not signed in on the primary domain, they complete the sign-in (or sign-up) flow there and are then redirected back to the satellite domain.
42
+
1. After the initial sync, signing out from either domain signs out from all domains.
43
+
44
+
If you set `satelliteAutoSync: true`, the satellite domain will automatically redirect to the primary domain on first load to sync authentication state, even if the user has no session. This matches the original Core 2 behavior and is useful if you want users who are already signed in on the primary domain to be automatically recognized on the satellite without needing to select "Sign in". However, this comes with a performance cost since every first visit triggers a redirect.
31
45
32
46
## How to add satellite domains
33
47
@@ -37,7 +51,7 @@ To access authentication state from a satellite domain, users will be transparen
37
51
### Create your application and install Clerk
38
52
39
53
> [!WARNING]
40
-
> Currently, multi-domain can be added to any Next.jsor Remix application. For other React frameworks, multi-domain is still supported as long as you do not use server rendering or hydration.
54
+
> Currently, multi-domain can be added to any Next.js, TanStack Start, or Nuxt application. For other React frameworks, multi-domain is still supported as long as you do not use server rendering or hydration.
41
55
42
56
To get started, you need to create an application from the [Clerk Dashboard](https://dashboard.clerk.com/). Once you create an instance via the Clerk Dashboard, you will be prompted to choose a domain. This is your primary domain. For the purposes of this guide:
43
57
@@ -331,6 +345,10 @@ To access authentication state from a satellite domain, users will be transparen
331
345
domain: 'https://satellite.dev',
332
346
// Or, in development:
333
347
// domain: 'http://localhost:3001',
348
+
349
+
// Uncomment to automatically sync auth state on first load.
350
+
// This will add a redirect on first visit, which comes with a performance cost since every first visit triggers a redirect.
@@ -421,17 +439,43 @@ To access authentication state from a satellite domain, users will be transparen
421
439
</Tab>
422
440
</Tabs>
423
441
424
-
### Ready to go 🎉
442
+
### Ready to go
425
443
426
444
Your satellite application should now be able to access the authentication state from your satellite domain!
427
445
428
-
You can see it in action by:
429
-
430
-
1. Visiting the primary domain and signing in.
431
-
1. Visiting the satellite domain.
432
-
1. You now have an active session in the satellite domain, so you can see the [`<UserProfile />`](/docs/reference/components/user/user-profile) component and update your information.
446
+
To verify it's working, visit your satellite domain and select "Sign in" — you should be redirected to the primary domain and back with an active session. For details on the sync flow, see the [How authentication syncing works](#how-authentication-syncing-works) section.
433
447
434
448
You can repeat this process and create as many satellite applications as you need.
435
449
</Steps>
436
450
451
+
## Migrating from Core 2
452
+
453
+
In Core 2, satellite applications automatically synced authentication state with the primary domain on every first page load by redirecting users to the primary domain and back. This happened regardless of whether the user had an active session, which caused unnecessary latency for apps where most visitors are anonymous.
454
+
455
+
In Core 3, this behavior is controlled by the `satelliteAutoSync` option, which defaults to `false`. This means satellite apps no longer perform automatic redirects on first visit.
456
+
457
+
### What changed
458
+
459
+
|| Core 2 | Core 3 (default) |
460
+
| - | - | - |
461
+
| First visit to satellite | Redirects to primary domain to sync state, then back | No redirect, page loads immediately |
462
+
| Sign-in flow | Same as Core 3 | User selects "Sign in" → redirected to primary → signs in → redirected back |
463
+
| Already signed in on primary | Automatically synced on first visit | Only synced after user selects "Sign in" (redirect is instant, no user action needed) |
464
+
| Sign-out | Signs out from all domains | Signs out from all domains |
465
+
| Performance | Redirect on every first visit | No upfront cost |
466
+
467
+
### To preserve Core 2 behavior
468
+
469
+
If your application relies on users being automatically recognized on the satellite domain without selecting "Sign in", set `satelliteAutoSync` to `true`:
470
+
471
+
```ts {{ prettier: false }}
472
+
// In your middleware options or ClerkProvider props
473
+
{
474
+
isSatellite: true,
475
+
domain: 'satellite.dev',
476
+
signInUrl: 'https://primary.dev/sign-in',
477
+
satelliteAutoSync: true, // Opt-in to automatic sync on first load
478
+
}
479
+
```
480
+
437
481
If you have any questions about satellite domains, or you're having any trouble setting this up, contact [support@clerk.com](mailto:support@clerk.com)
0 commit comments