Authenticate users in milliseconds at edge with Clerk and Next.js
Clerk supports both stateless and stateful authentication at the edge
Before a request, Clerk generates a short-lived JWT (JSON Web Token) for authentication. Verifying the JWT takes less than 1 ms!
Clerks API is used to authenticate the user. This adds network latency, but enables sessions to be revoked immediately.
Short-lived, automatically-refreshing JWTs provide simple, robust security
Each JWT only lasts 60 seconds. If a session needs to be revoked, this short lifetime ensures attackers will be stopped within 60 seconds.
Clerk's Next.js SDK automatically refreshes tokens before they expire, so there's no extra work for developers. Watch it in real - time below.
Sign in on two devices to test revocation
Stateless, revocable authentication is included in every Clerk plan.