Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to


The currentUser helper returns the Backend API User(opens in a new tab) object of the currently active user. It can be used in Server Components, Route Handlers, and Server Actions. Under the hood, this helper calls fetch() so it is automatically deduped per request.

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>; }

Last updated on February 23, 2024

What did you think of this content?

Clerk © 2024