This SDK documentation is outdated. Please do not refer to it, and instead visit the User Guides section.

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
Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI