Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.dev

API Routes

The getAuth() helper retrieves the authentication state allowing you to protect your API routes or gather relevant data.

1

Before Next.js 12.2

You can use withAuth to retrieve data and use requireAuth to protect your route automatically while retrieveing data.

1
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