How do I read the session on the server in Next.js?
Call auth() from @clerk/nextjs/server inside Server Components, Route Handlers, and middleware. It returns the session claims (userId, sessionId, orgId, getToken, and helpers like has()) without a network call. To load the full user profile, call currentUser().
What is the difference between auth() and currentUser()?
auth() reads claims directly from the verified session token, so it is fast and does no network round-trip. currentUser() calls Clerk's Backend API to fetch the complete, current User object, which costs a request. Use auth() for ids and authorization checks; use currentUser() when you need profile data.
What is getToken() for?
getToken() mints a JWT you can forward to your own backend or a third-party service. Called with a template name, getToken({ template }) returns a token shaped by that JWT template's custom claims; called without one it returns the default session token.
Which hooks expose auth state on the client?
useAuth() gives ids, the active org, and helpers (has, getToken, signOut). useUser() returns the full user profile. useSession() exposes the active session and its expiry. useClerk() returns the Clerk singleton for imperative actions like opening modals or switching the active session.