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

Clerk · Pipe

redirectToSignIn

redirectToSignIn navigates to the sign-in URL configured in the application's instance. It returns a promise that can be awaited for navigation completion.

How it works

Call redirectToSignIn when an unauthenticated user must reach the sign-in URL configured for the application instance. It performs navigation through Clerk's navigation mechanism and returns a promise that can be awaited when code needs to observe navigation completion; the promise's resolved value is framework-dependent.

Syntax

function redirectToSignIn(opts?: SignInRedirectOptions): Promise<unknown>

Parameters

NameTypeDescription
optsSignInRedirectOptionsOptional redirect configuration supplied to the sign-in navigation.

Returns

Promise<unknown>

Key points

  • It sends the user to the sign-in destination configured for the application instance.
  • Clerk implements the operation through its navigation mechanism.
  • Treat the promise as a completion signal, not as a stable value to inspect.

Common mistakes

  • Do not depend on the promise's resolved value because Clerk says it may differ between frameworks.

Example: Redirect from a protected page

import { redirectToSignIn } from '@clerk/nextjs'

export default function ProtectedPage() {
  redirectToSignIn()
  return null
}

Redirects the current request to the configured sign-in URL.

When to use it

Protect a route

A protected route detects that the visitor is not authenticated and sends them to Clerk's configured sign-in destination.

Observe navigation completion

Application code needs to wait until Clerk finishes navigation before continuing framework-specific work.

Interview questions

QWhat does redirectToSignIn do and what does it return?

redirectToSignIn(opts?: SignInRedirectOptions) returns Promise<unknown>. It redirects to the sign-in URL configured in the application's instance and uses navigate() internally.

Follow-up: Why might code await the result? To observe when navigation finishes, but not to consume a stable return value.

QHow is the redirect destination selected?

The destination is controlled by the sign-in URL configured in the application instance. The method performs navigation rather than merely opening a sign-in UI.

Follow-up: How should destination configuration be handled? Configure the application's sign-in URL instead of assuming a hard-coded destination.

QWhen would you await the returned promise?

The method uses navigate() under the hood, and its returned promise can be awaited to listen for navigation completion. The promise's inner value is not a portable API contract.

Follow-up: What should a cross-framework integration avoid? Branching on the resolved value, because it can change with the framework.

  • SignInRedirectOptions
  • navigate()
  • openSignIn()
  • <SignIn />

Source: Clerk class - Objects - Next.js. Checked 2026-10-15.