Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Clerk · Pipe

afterSignOutUrl

afterSignOutUrl defines the URL or path Clerk uses after a successful sign-out. Read it with buildAfterSignOutUrl() or navigate to it with redirectToAfterSignOut().

How it works

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.

Syntax

afterSignOutUrl?: string | null
buildAfterSignOutUrl(): string
redirectToAfterSignOut(): void

Returns

The afterSignOutUrl setting is string | null; buildAfterSignOutUrl() returns string and redirectToAfterSignOut() returns void.

Key points

  • The setting may contain either an absolute URL or an application path.
  • buildAfterSignOutUrl() exposes the instance's configured post-sign-out destination.
  • The URL builder returns a string.
  • redirectToAfterSignOut() uses the configured destination to navigate the user.

Common mistakes

  • The value is a destination, not a callback or sign-out operation; sign-out must complete successfully before it is used.
  • When supplying a redirect URL through the sign-out flow, ensure it is the intended destination after completion.

Example: Read the post-sign-out destination

const destination = clerk.buildAfterSignOutUrl();
console.log(destination);

Reads the configured destination that Clerk uses after a successful sign-out.

When to use it

Send users to a public landing page after sign-out.

Post-logout routing

Display or validate the configured post-sign-out destination before navigation.

Destination inspection

Reuse Clerk's configured destination rather than duplicating logout routing logic.

Centralized logout behavior

Interview questions

QWhat does afterSignOutUrl control?

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.

QHow can code read the configured destination?

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().

QHow does Clerk perform the redirect?

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

Source: Clerk class - Objects - JavaScript | Clerk Docs. Checked 2026-10-15.