<StackHandler />

Renders the appropriate authentication or account-related component based on the current route.

For detailed usage instructions, please refer to the manual section of the setup guide.

Props

PropTypeDefaultDescription
app
StackServerAppThe Stack server application instance.
routeProps
NextRoutePropsThe Next.js route props, usually the first argument of the page component (see below)
fullPage
booleanWhether to render the component in full-page mode.
componentProps
{ [K in keyof Components]?: Partial<ComponentProps<Components[K]>> }Props to pass to the rendered components.

Example

app/handler/[...stack].tsx
import { StackHandler } from '@stackframe/stack';
import { stackServerApp } from "@/stack";

export default function Handler(props: { params: any, searchParams: any }) {
  return (
    <StackHandler
      app={stackServerApp}
      routeProps={props}
      fullPage={true}
      componentProps={{
        SignIn: { /* SignIn component props */ },
        SignUp: { /* SignUp component props */ },
        // ... other component props
      }}
    />
  );
}

Table of Contents

Navigate this page

On this page

Stack Auth AI

Documentation assistant

Experimental: AI responses may not always be accurate—please verify important details.

For the most accurate information, please join our Discord or email us.

How can I help?

Ask me about Stack Auth while you browse the docs.

<StackHandler />