Skip to Content
You are viewing a beta version of Clerk Docs
Visit the latest docs
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

Redirect methods

These methods on the Clerk class help you manage route navigation based on the Clerk dashboard configuration.

Helper method which will use the custom push navigation function of your application to navigate to the provided URL or relative path.

function navigate(to: string | undefined): Promise<unknown>;
NameTypeDescription
tostring | undefinedThe route to navigate to.
TypeDescription
Promise<unknown>A promise that can be awaited in order to listen for the navigation to finish.
The inner value should not be relied on, as it can change based on the framework it's used within.

redirectWithAuth()

Redirects to the provided url after decorating it with the auth token for development instances.

function redirectWithAuth(to: string): Promise<unknown>;

redirectWithAuth() params

NameTypeDescription
tostring | undefinedThe route to navigate to

redirectWithAuth() returns

TypeDescription
Promise<unknown>A promise that can be awaited in order to listen for the navigation to finish.
The inner value should not be relied on, as it can change based on the framework it's used within.

redirectToSignIn()

Redirects to the sign-in URL, as configured in your application's instance settings. This method uses the navigate() method under the hood.

function redirectToSignIn(options?: SignInRedirectOptions): Promise<unknown>;

redirectToSignIn() params

NameTypeDescription
options?SignInRedirectOptions | undefinedOptions to use in the redirect

redirectToSignIn() returns

TypeDescription
Promise<unknown>A promise that can be awaited in order to listen for the navigation to finish.
The inner value should not be relied on, as it can change based on the framework it's used within.

redirectToSignUp()

Redirects to the sign-up URL, as configured in your application's instance settings. This method uses the navigate() method under the hood.

function redirectToSignUp(options?: SignUpRedirectOptions): Promise<unknown>;

redirectToSignUp() params

NameTypeDescription
options?SignUpRedirectOptions | undefinedOptions to use in the redirect

redirectToSignUp() returns

TypeDescription
Promise<unknown>A promise that can be awaited in order to listen for the navigation to finish.
The inner value should not be relied on, as it can change based on the framework it's used within.

redirectToUserProfile()

Redirects to the user profile management URL, as configured in your application's instance settings. This method uses the navigate() method under the hood.

function redirectToUserProfile(): Promise<unknown>;

redirectToUserProfile() returns

TypeDescription
Promise<unknown>A promise that can be awaited in order to listen for the navigation to finish.
The inner value should not be relied on, as it can change based on the framework it's used within.

redirectToCreateOrganization()

Redirects to the configured URL where <CreateOrganization /> is mounted. This method uses the navigate() method under the hood.

function redirectToCreateOrganization(): Promise<unknown>;

redirectToCreateOrganization() returns

TypeDescription
Promise<unknown>A promise that can be awaited in order to listen for the navigation to finish.
The inner value should not be relied on, as it can change based on the framework it's used within.

redirectToOrganizationProfile()

Redirects to the configured URL where <OrganizationProfile /> is mounted. This method uses the navigate() method under the hood.

function redirectToOrganizationProfile(): Promise<unknown>;

redirectToOrganizationProfile() returns

TypeDescription
Promise<unknown>A promise that can be awaited in order to listen for the navigation to finish.
The inner value should not be relied on, as it can change based on the framework it's used within.

Last updated on March 8, 2024

What did you think of this content?

Clerk © 2024