User
After instantiating the SDK (which is explained here), you’re allowed to use the following methods from user.
getInfo
Retrieves information for the authenticated user. Assumes a user is already logged in, otherwise it will throw an error.
Parameters
void
Returns
Promise<User>
Example
const user = await sdk.user.getInfo()isLoggedIn
Checks if a user is currently logged in.
Parameters
void
Returns
Promise<boolean>
Example
const user = await sdk.user.isLoggedIn()getToken
Generates an access token with a lifespan of 15 minutes. Assumes a user is already logged in, otherwise it will throw an error.
Parameters
void
Returns
Promise<string>
Example
const user = await sdk.user.getToken()logout
Logs out the user.
Parameters
void
Returns
Promise<void>
Example
const user = await sdk.user.logout()