User — TypeScript SDK
User profile reference.
Overview
The User resource exposes a single endpoint returning the currently logged-in user's full profile, including tenant context, BUC IDs, and permission metadata.
Accessed via client.user.
Available Operations
| Method | Description |
|---|---|
info() | Get the current logged-in user's information |
info
Get the current logged-in user's full profile.
Example Usage
import { WltClient } from 'wlt-platform';
const client = new WltClient({ apiKey: 'your-api-key', baseUrl: 'https://console.example.com' });
const me = await client.user.info();
console.log(me.userName, me.partnerId);
console.log(`Tenant: ${me.partnerName} (id=${me.partnerId})`);
Parameters
None.
Response
Returns LoginUser:
| Field | Type | Description |
|---|---|---|
userId | number | User ID |
userName | string | Username |
userType | string | User type (e.g. PartnerUser, PartnerUserSub) |
accountStructure | number | 1=Partner, 2=Customer main account, 3=SubUser, 4=TokenLogin |
tenantCode | string | Tenant code |
partnerId | number | Tenant ID |
partnerName | string | Tenant name |
partnerLogoUrl | string | Tenant logo URL |
bucId | number | BUC ID |
bid | string | BID |
parentUserId | number | Parent account database ID |
parentPk | string | Parent account PK info |
aliyunPk | string | Aliyun PK info |
cmUserId | string | CM user ID |
accessKeyId | string | AccessKey ID |
securityToken | string | Security token |
timezone | string | Timezone info |
region | string | Region info |
needAuth | boolean | Whether SLR authorization is needed |
userPermission | UserPermissionResponse | User permission info |
sourceExternalTicket | string | SSO external ticket |
thirdChannel | string | Third-party channel source |
Errors
| Code | Error | When |
|---|---|---|
2000 / 2002 | Authentication failure | API Key invalid |
2007 | Permission denied | Token lacks permission |
3001 | Token expired | Refresh failed |