v2.1.0

ProfileManager

Parsed profile REST response: id, name, last name, gender, photo, time zone, admin flag.

ProfileManager wraps the response of the profile REST method. Created by B24HelperManager.loadData when LoadDataType.Profile is requested; reachable through B24HelperManager.profileInfo.

Usage

import { useB24Helper, LoadDataType } from '@bitrix24/b24jssdk'

const { initB24Helper, getB24Helper } = useB24Helper()
await initB24Helper($b24, [LoadDataType.Profile])

const profile = getB24Helper().profileInfo.data
console.log(profile.id, profile.name, profile.lastName, profile.isAdmin)

Getter data

get data(): TypeUser

Returns the typed profile snapshot. Throws 'ProfileManager.data not initialized' if loadData has not been called yet.

TypeUser Fields

FieldTypeDescription
idnull | numberUser identifier.
isAdminbooleantrue if the user has admin rights on the portal.
namenull | stringFirst name.
lastNamenull | stringLast name.
gender'M' | 'F' | '''M' / 'F' / '' (no value).
photonull | stringProfile photo URL.
TimeZonenull | stringIANA time zone (e.g. Europe/Moscow).
TimeZoneOffsetnull | numberOffset in seconds.