Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to


The currentUser helper returns the User object of the currently active user. This is the same User object that is returned by the useUser hook. However, it can be used in server components, route handlers, and server actions.

import { currentUser } from '@clerk/nextjs'; export default async function Page() { const user = await currentUser(); if (!user) return <div>Not logged in</div>; return <div>Hello {user?.firstName}</div>; }

What did you think of this content?

Clerk © 2023