Anonymous Users
Anonymous users allow you to treat visitors as first-class identities before they provide a verified email, phone number, or username.
You can reduce registration friction while still using Descope as your customer identity layer: issue session tokens, attach custom data, and later convert the same anonymous user to a standard user while retaining information you collected during the anonymous phase.
How Anonymous Users Work
Descope represents an anonymous user by issuing a dedicated anonymous session JWT (not a standard user record with login IDs). That token:
- Is signed by Descope and behaves like other session tokens for your app (e.g. API authorization).
- Has a lifetime tied to the JWT (and refresh behavior you configure)—when the session expires, that anonymous identity ends unless you refresh or convert the user.
- Carries a
danuclaim (true) in the payload so your backend can tell this is an anonymous session. - Can include custom claims (for example user preferences, unverified email addresses, or app-specific flags) for use in your product.
When you are ready, you can convert the anonymous user to a regular user, without losing any data you've already gathered on the user.
See our blog on Boosting conversions with anonymous users and guest checkout.
Creating Anonymous Users
With Flows
The Create Anonymous user - Add Information To JWT flow template provides a starting point. Upon completion, Descope issues an anonymous identity token.
![]()
The following example illustrates a typical JWT payload and header after the flow runs. The danu claim marks the session as anonymous; displayName (or any claims you configure) represents optional custom data for your application:
With SDKs
You can use the Descope Management SDK to mint an anonymous session JWT programmatically. A management key is required. For broader SDK setup, see User management SDKs.
Install the SDK
Import and initialize Management SDK
Create an anonymous user
This operation creates an anonymous user within the project with the details provided.
Converting Anonymous Users to Regular Users
With Flows
To move from an anonymous session to a regular user, use a flow such as Anonymous User Conversion. This flow authenticates the user and links a verified login ID while preserving context from the anonymous phase.
![]()
- The template demonstrates one authentication pattern; you can adapt the same approach to other factors your product supports.
- Verify ownership of the login ID (for example via magic link or OTP) before completing conversion. Doing so prevents users from attaching an email or phone number that already belongs to another account.
With SDKs
If you handle conversion in your backend (instead of using a flow), follow the same rules as above: verify a real login ID, then create a full user and copy over data you stored in the anonymous JWT.
Typical Steps:
- Validate the anonymous session JWT.
- Extract the claims you intend to keep for the user.
- Create the new user using any of the authentication methods in our Client SDKs. Populate custom attributes and other fields from the anonymous user claims.