Get User or Parameter

A parameter for the getUser method.

or"return-null" | "redirect" | "throw"

What to do if the user is not signed in. Defaults to "return-null".

"return-null"

Returns null. The default.

"redirect"

Redirects the user to the signIn URL.

"throw"

Throws an error.

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.