Reading the User ID
getUserId
function: API Reference
The import SuperTokensRequest from 'supertokens-website';
let userId = await SuperTokensRequest.getUserId();
let userId = await supertokens.getUserId();
- Returns a
string
or throws an error in case a session does not exist