Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.dev

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.

1

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.

1

Example Response

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

Was this helpful?

Clerk © 2022