Class: AccountResource
Auth Core
.activatePromo(promo): Promise<BaseOkay>
1.0.0
Activate promo code
Parameters
| Name | Type | Description |
|---|---|---|
promo | string | Promo code |
Returns
Promise<BaseOkay>
Promo activation response
Throws
If promo code is invalid
Example
javascript
const result = await rest.auth.activatePromo('PROMO2024');.confirm(code, hCaptchaResponse): Promise<BaseOkay>
1.0.0
Confirm account registration
Parameters
| Name | Type | Description |
|---|---|---|
code | string | Confirmation code |
hCaptchaResponse | string | hCaptcha response |
Returns
Promise<BaseOkay>
Confirmation response
Throws
If confirmation data is invalid
Example
javascript
const response = await rest.auth.confirm('123456', 'captcha_response');getTokens()
getTokens():
Promise<Token[]>
Get user tokens
Returns
Promise<Token[]>
User tokens
Example
javascript
const tokens = await rest.auth.getTokens();.login(email, password): Promise<Login>
1.0.0
Login to account
Parameters
| Name | Type | Description |
|---|---|---|
email | string | User email |
password | string | User password |
Returns
Promise<Login>
Login response
Throws
If credentials are invalid
Example
javascript
const response = await rest.auth.login('user@example.com', 'password123');logout()
logout():
Promise<BaseOkay>
Logout from account
Returns
Promise<BaseOkay>
Logout response
Example
javascript
await rest.auth.logout();.register(name, email, password, surname): Promise<BaseOkay>
1.0.0
Register new account
Parameters
| Name | Type | Description |
|---|---|---|
name | string | User name |
email | string | User email |
password | string | User password |
surname? | string | User surname |
Returns
Promise<BaseOkay>
Registration response
Throws
If registration data is invalid
Example
javascript
const response = await rest.auth.register('John', 'john@example.com', 'password123', 'Doe');.resetPassword(email): Promise<BaseOkay>
1.0.0
Reset password
Parameters
| Name | Type | Description |
|---|---|---|
email | string | User email |
Returns
Promise<BaseOkay>
Reset response
Throws
If email is invalid
Example
javascript
await rest.auth.resetPassword('user@example.com');Profile
.update(settings): Promise<BaseOkay>
1.0.0
Update profile settings
Parameters
| Name | Type | Description |
|---|---|---|
settings | SettingsPayload | Profile settings to update |
Returns
Promise<BaseOkay>
Update response
Example
javascript
await rest.account.update({ name: 'John', status: 'Online' });