The UserProfile object provides profile information about the current user.
A profile object can be created with the TurbulenzServices.createUserProfile method.
Required scripts
The UserProfile object requires:
/*{{ javascript("jslib/utilities.js") }}*/
/*{{ javascript("jslib/services/turbulenzservices.js") }}*/
Summary
String with the username provided by the user. This is a unique name containing only the characters 0-9, A-Z, a-z and hyphen “-”.
Syntax
var name = userProfile.username;
Note
Read Only
Summary
String with the real name provided by the user. This is not unique to the user and can contain any characters.
Note
This is an optional field which the user may not have set. Games should generally use the username to refer to the player.
Syntax
var name = userProfile.displayname;
Note
Read Only
Summary
Number with the age provided by the user.
Syntax
var age = userProfile.age;
if (age)
{
// User provided date of birth information
}
Note
Read Only
Summary
String with the preferred language chosen by the user. It follows the two-letter code standard ISO 639-1.
Syntax
var language = userProfile.language;
if (language)
{
// User provided preferred language
}
Note
Read Only
Summary
String with the country of residence provided by the user. It follows the two-letter code standard ISO 3166-1.
Syntax
var country = userProfile.country;
if (country)
{
// User provided country of residence
}
Note
Read Only
Summary
True if the current user is a guest.
Syntax
var guest = userProfile.guest;
if (guest)
{
// Ask user to create an account to purchase items
}
Note
Read Only