Onboarding
Send newly registered users to an onboarding route.
Clerk · Pipe
afterSignUpUrl is the URL or path Clerk uses after a successful sign-up. Configure it in the JavaScript SDK and retrieve the resolved destination with buildAfterSignUpUrl().
afterSignUpUrl identifies the full URL or path Clerk should use after a successful sign-up. In the JavaScript SDK, provide it while loading Clerk, then call buildAfterSignUpUrl() to obtain the configured destination; the builder can also receive URL search parameters.
Clerk.load({ afterSignUpUrl: string });
Clerk.buildAfterSignUpUrl(params?: { params?: URLSearchParams }): string| Name | Type | Description |
|---|---|---|
afterSignUpUrl | string | Full URL or path to navigate to after successful sign-up. |
params | { params?: URLSearchParams } | Optional object containing URL search parameters used when building the destination. |
A string containing the configured post-sign-up URL.
afterSignUpUrl to direct a newly registered user to a path or complete URL after sign-up succeeds.ClerkProvider.Clerk.load.buildAfterSignUpUrl returns the configured destination and optionally accepts URL search parameters.redirect_url and then /.afterSignUpUrl prop.import { Clerk } from '@clerk/clerk-js';
await Clerk.load({ afterSignUpUrl: '/welcome' });
const destination = Clerk.buildAfterSignUpUrl();
console.log(destination);Configures the post-sign-up destination and reads the resulting URL from the loaded Clerk instance.
Send newly registered users to an onboarding route.
Take users to the application home page after registration.
Build a destination that preserves query parameters.
afterSignUpUrl control?It is the full URL or path Clerk uses after a successful sign-in or sign-up. In the JavaScript SDK, it can be supplied to Clerk.load, and buildAfterSignUpUrl() returns the configured value.
Follow-up: How can the resulting URL include query parameters? Call buildAfterSignUpUrl({ params }), where params is a URLSearchParams instance.
The JavaScript SDK accepts it in the options passed to Clerk.load, for example { afterSignUpUrl: '/welcome' }. After loading, Clerk.buildAfterSignUpUrl() returns the configured destination as a string.
Follow-up: What is the builder's signature? buildAfterSignUpUrl(params?: { params?: URLSearchParams }): string.
The documented default is / when no post-sign-up destination is otherwise supplied. A request redirect_url can take precedence before that fallback in the redirect flow.
Follow-up: What should a Core 2 migration use to preserve an explicit fallback destination? Use signUpFallbackRedirectUrl rather than the older afterSignUpUrl prop.
afterSignInUrlbuildAfterSignUpUrlsignUpFallbackRedirectUrlredirect_urlClerk.load