The clerkMiddleware() function checks the request's cookies and headers for a session JWT. If the user has a valid session, the clerkMiddleware() function attaches the properties of the authenticated user to the request object.
For more information on the Middleware functions and SDK features, see the Express SDK page.
The clerkPlugin checks the request's cookies and headers for a session JWT. If the user has a valid session, the clerkPlugin attaches the properties of the authenticated user to the request object.
For more information on the Clerk plugin and SDK features, see the Fastify SDK page.