When users sign in with Dynamic, the SDK receives a JSON Web Token (JWT). The SDK uses it to build the user object and Verified Credentials. For what JWTs are, how Dynamic uses them, and how to verify them on your backend, see Server-side auth and JWT. If you don’t need to access the JWT directly, you can use the user object instead—see the Users section.
The getAuthToken utility function will return the JWT token to you from local storage as long as the user is logged in. It will return undefined otherwise.
Normally, you do not need to use the JWT directly, as all of the information/claims are stored on the user object, which you can learn about in the Users section.If however you are doing server-side verification, you can use the JWT to verify the user’s identity. For an SDK-agnostic explanation of JWTs and how to verify them on your backend, see Server-side auth and JWT. For SDK-specific steps and code samples, see Server-side verification.