Access
Connect cross-platform accounts & identity management
AccelByte Cloud’s Profile services allow players to display information about themselves, such as their name, location, date of birth, and photos. Beyond these basic attributes, you can also create your own attributes to customize the player profiles for your game. For example, you can add attributes that include a player’s level or rank. When you add these custom attributes to the Profile service, that information will be displayed on each player’s profile.
Custom Attributes are added using the SDK. In the sample code below, four custom attributes have been added: level, rank, equipped sword, and equipped shield. When this code is implemented, these attributes will appear in each player’s profile.
{
"userId": "string",
"namespace": "string",
"firstName": "string",
"lastName": "string",
"avatarSmallUrl": "string",
"avatarUrl": "string",
"avatarLargeUrl": "string",
"status": "ACTIVE",
"language": "string",
"timeZone": "string",
"dateOfBirth": "2019-12-22",
"customAttributes": {
"level": "1",
"rank": "Grand Master",
"activeWeapon": "Copper Sword",
"activeShield": "Pot Lid"
}
}
Use the following function to create a player profile:
You can retrieve a player profile using the following function. This function will retrieve the player’s personal information, such as First Name, Last Name, Language, etc.
If you need to get a player's public profile, you can use the following function. The public profile is the profile that other players see when interacting in the game. When retrieving a player’s public profile, you will receive the player’s User ID, Namespace, Timezone, and Avatar URL.
Use the following function to update a player profile:
The following function can be used to update a specific custom attribute field.
You can retrieve a player profile with its custom attributes using the following function:
You can retrieve a public player profile with custom attributes using the following function and specifying the user ID.
Before you can use the Cloud Basic service (which includes the Profile service) , you will need to initialize the server-side SDKs to ensure you can create, read, update, and delete profiles.
Before you can use the Basic service from the Golang SDK, you will need to initialize it by following the steps below:
Once you have completed these steps, you can use the Golang SDK to manage the Basic service from your serverless app.
Before you can use the Basic service from the Python SDK, you will need to initialize the itby following the steps below:
Once you have completed these steps, you can use the Python SDK to manage the Basic service from your serverless app.
Before you can use the Basic service, you will need to set some permissions. Use the following .NET namespaces to do this:
using AccelByte.Sdk.Api.Basic.Model;
using AccelByte.Sdk.Api.Basic.Operation;
using AccelByte.Sdk.Api.Basic.Wrapper;
Before you can use the Basic service, you will need to set some permissions.
Initialize the UserProfile wrapper from the Basic service using the following code:
UserProfile wProfile = new UserProfile(sdk);
Once you have completed this step, you can use the SDK to manage player profiles.
Use the following function to create a player profile (opens new window):
Use the following function to delete a player profile (opens new window):
Use the following function to retrieve a public profile (opens new window):
Use the following function to update a player profile (opens new window):