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

  • app: StackServerApp - The Stack server application instance.
  • params: { stack?: string[] } - The route parameters, where stack is an array of path segments.
  • searchParams: Record<string, string> - The URL search parameters.
  • fullPage: boolean - Whether 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
1import { StackHandler } from '@stackframe/stack';
2import { stackServerApp } from "@/stack";
3
4export default function Hanlder(props: { params: any, searchParams: any }) {
5 return (
6 <StackHandler
7 app={stackServerApp}
8 params={props.params}
9 searchParams={props.searchParams}
10 fullPage={true}
11 componentProps={{
12 SignIn: { /* SignIn component props */ },
13 SignUp: { /* SignUp component props */ },
14 // ... other component props
15 }}
16 />
17 );
18}