Skip to main content
Version: 8.2.X

Reading the User ID

The getUserId function#

import SuperTokens from 'supertokens-website';
let userId = await SuperTokens.getUserId();
  • Returns a string or throws an error in case a session does not exist
Which frontend SDK do you use?
supertokens-web-js / mobile
supertokens-auth-react