User
After instantiating the SDK (which is explained here), you’re allowed to use the following methods from user.
getInfo
Section titled “getInfo”Retrieves information for the authenticated user. Assumes a user is already logged in, otherwise it will throw an error.
Parameters
Section titled “Parameters”void
Returns
Section titled “Returns”Promise<User>
Example
Section titled “Example”const user = await sdk.user.getInfo()isLoggedIn
Section titled “isLoggedIn”Checks if a user is currently logged in.
Parameters
Section titled “Parameters”void
Returns
Section titled “Returns”Promise<boolean>
Example
Section titled “Example”const user = await sdk.user.isLoggedIn()getToken
Section titled “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
Section titled “Parameters”void
Returns
Section titled “Returns”Promise<string>
Example
Section titled “Example”const user = await sdk.user.getToken()logout
Section titled “logout”Logs out the user.
Parameters
Section titled “Parameters”void
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”const user = await sdk.user.logout()