Docs

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.

Returns 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.

function navigate(to: string | undefined): Promise<unknown>;
  • Name
    to
    Type
    string | undefined
    Description

    The route to navigate to.

redirectWithAuth()

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

Returns 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.

function redirectWithAuth(to: string): Promise<unknown>;
  • Name
    to
    Type
    string | undefined
    Description

    The route to navigate to

redirectToSignIn()

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

Returns 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.

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

redirectToSignUp()

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

Returns 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.

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

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.

Returns 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.

function redirectToUserProfile(): Promise<unknown>;

redirectToCreateOrganization()

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

Returns 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.

function redirectToCreateOrganization(): Promise<unknown>;

redirectToOrganizationProfile()

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

Returns 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.

function redirectToOrganizationProfile(): Promise<unknown>;

Feedback

What did you think of this content?