Route Handlers
Clerk provides helpers to allow you to protect your Route Handlers, fetch the current user, and interact with the Clerk API.
Protecting Route Handlers
If you aren't protecting your Route Handler using Clerk's middleware, you can check if the user is signed in.
Retrieving data from external sources
Clerk provides integrations with a number of popular databases. Below is an example of retrieving a template to be used.
Retrieve the current user
In some cases, you might need the current user in your Route Handler. Clerk provides an asynchronous helper called currentUser
to retrieve it.
Interacting with Clerk's API
The clerkClient
helper allows you to retrieve and update data from Clerk's API.
Feedback
Last updated on