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