Clerk logo

Clerk Docs

Ctrl + K
Go to

Pages (React)

The most common way developers protect pages in Next.js is using our Control Components.

The following example shows you how to compose control components in _app at the root of your /pages directory.


Accessing auth state

The useAuth hook is a convenient way to access the current auth state. This hook provides the minimal information needed for data-loading and helper methods to manage the current active session.


Example Response

More detailed information about the fields in this object can be found in the Authentication Object documentation.

Was this helpful?

Clerk © 2022