Reading the User ID
getUserId
function#
The - Via NPM
- Via Script Tag
import SuperTokens from 'supertokens-website';
let userId = await SuperTokens.getUserId();
let userId = await supertokens.getUserId();
- Returns a
string
or throws an error in case a session does not exist