Skip to main content

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​

MethodDescription
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:

FieldTypeDescription
userIdnumberUser ID
userNamestringUsername
userTypestringUser type (e.g. PartnerUser, PartnerUserSub)
accountStructurenumber1=Partner, 2=Customer main account, 3=SubUser, 4=TokenLogin
tenantCodestringTenant code
partnerIdnumberTenant ID
partnerNamestringTenant name
partnerLogoUrlstringTenant logo URL
bucIdnumberBUC ID
bidstringBID
parentUserIdnumberParent account database ID
parentPkstringParent account PK info
aliyunPkstringAliyun PK info
cmUserIdstringCM user ID
accessKeyIdstringAccessKey ID
securityTokenstringSecurity token
timezonestringTimezone info
regionstringRegion info
needAuthbooleanWhether SLR authorization is needed
userPermissionUserPermissionResponseUser permission info
sourceExternalTicketstringSSO external ticket
thirdChannelstringThird-party channel source

Errors​

CodeErrorWhen
2000 / 2002Authentication failureAPI Key invalid
2007Permission deniedToken lacks permission
3001Token expiredRefresh failed