Send users to a public landing page after sign-out.
Post-logout routing
Clerk · Pipe
afterSignOutUrl defines the URL or path Clerk uses after a successful sign-out. Read it with buildAfterSignOutUrl() or navigate to it with redirectToAfterSignOut().
Clerk uses afterSignOutUrl to determine the full URL or path users should visit after they successfully sign out. The configured value can be inspected with buildAfterSignOutUrl(), while redirectToAfterSignOut() performs navigation to that destination.
afterSignOutUrl?: string | null
buildAfterSignOutUrl(): string
redirectToAfterSignOut(): voidThe afterSignOutUrl setting is string | null; buildAfterSignOutUrl() returns string and redirectToAfterSignOut() returns void.
const destination = clerk.buildAfterSignOutUrl();
console.log(destination);Reads the configured destination that Clerk uses after a successful sign-out.
Post-logout routing
Destination inspection
Centralized logout behavior
afterSignOutUrl is a configured URL or path used after a successful sign-out. buildAfterSignOutUrl() returns the configured destination as a string.
Follow-up: How would you navigate using the configured value? Call redirectToAfterSignOut(), which redirects to the configured post-sign-out URL.
Use buildAfterSignOutUrl() when code needs to inspect the configured destination without navigating. Its declared return type is string.
Follow-up: What method performs navigation instead of only reading the destination? redirectToAfterSignOut().
redirectToAfterSignOut() navigates to the configured after-sign-out destination. It is distinct from buildAfterSignOutUrl(), which only returns the URL.
Follow-up: What can be supplied when a flow needs an explicit destination? A redirect URL can be specified for navigation after sign-out completes.
buildAfterSignOutUrl()redirectToAfterSignOut()afterMultiSessionSingleSignOutUrl