Skip to content

User

After instantiating the SDK (which is explained here), you’re allowed to use the following methods from user.

Retrieves information for the authenticated user. Assumes a user is already logged in, otherwise it will throw an error.

void

Promise<User>

const user = await sdk.user.getInfo()

Checks if a user is currently logged in.

void

Promise<boolean>

const user = await sdk.user.isLoggedIn()

Generates an access token with a lifespan of 15 minutes. Assumes a user is already logged in, otherwise it will throw an error.

void

Promise<string>

const user = await sdk.user.getToken()

Logs out the user.

void

Promise<void>

const user = await sdk.user.logout()