User management

Learn about advanced setups from our how-tos.

How to work with user attributes

You can use attributes to manage additional information about the users of your application. The user attribute is a key-value pair. The SDK supports the following types of attributes:

  • User-editable attributes. The values for this type of attributes are entered by a user or specified according to the in-game logics on the client side. For example: the name and character stats, game difficulty level, etc.

  • Read-only attributes. The values for this type of attributes are entered and edited on the server side of your application. We recommend you use them for configuration of game character stats or user parameters that shouldn’t be changed a lot. For example: use them for the chance to get a bonus, game character key parameters, user categories, etc.

To manage user attributes, use the following SDK methods:

When working with read-only attributes, you can use a server token or a Publisher Account token for authorization.

To get the Publisher Account token:

  1. Enter your Publisher Account.
  2. Go to the cookie files viewpage via the developers’ tools in your browser.
  3. Copy the value from the pa-v4-token parameter and paste it to the Authorization header.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Hide

How to work with user account in your application

Users can configure the following data from a user account:

  • public profile data:
    • avatar
    • nickname

  • personal user data:
    • name and surname
    • birthdate
    • gender
    • phone number
    • email

Note
To set some additional user parameters or set the parameters of a game character, use the instruction on how to work with user attributes. You can add the friend list management functionality in the user account if the friend system is implemented in the application.

You can manage the user account via the API calls. The Login & Account System plug-in has the following methods implemented:

  • UpdateUserDetails — updates locally cached user data.

Note
The user can set their birthdate only once. The entered value can’t be changed in the future.

  • ModifyUserDetails — changes the specified user data.
  • UpdateUserEmail — updates the locally cached user email.
  • UpdateUserPhoneNumber — updates the locally cached user phone number.
  • ModifyUserPhoneNumber — changes the user’s phone number.
  • RemoveUserPhoneNumber — deletes the user’s phone number.
  • ModifyUserProfilePicture — changes the user’s avatar.
  • RemoveProfilePicture — deletes the user’s avatar.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Hide

How to work with friend system in your application

The friend system allows your users to find each other and set up social connections. The SDK supports the following functionality:

  • search by nickname
  • get the list of friends from social networks
  • manage the friend list, send invitations, add and remove friends, block users, etc.
  • manage personal data via the user account

To implement the friend system, you should have the user account functionality in your application. Methods of working with this system use the following parameters from the user account:

  • user ID
  • avatar
  • nickname

Users should specify the nickname to ensure the friend system works correctly. Implement the following nickname specification logics:

  • Use the name that was used for registration via login and password as a nickname.
  • Implement the nickname request during social authentication or platform accounts.

SDK methods

The Login & Account System plug-in has the following methods of working with the friend system:

  • UpdateFriends — updates the locally cached user friends data. The Get user’s friends API call is used alongside the SDK method.

  • ModifyFriends — updates the status of the user’s social connections. The Update user’s friends API call is used alongside the SDK method. The social connections status is affected by the following actions:
    • send or cancel a friend request
    • accept or decline a friend request
    • delete the user from the friend list
    • block or unblock the user

  • UpdateSocialFriends — updates the locally cached data of user’s friends from a social network. The Get social account friends API call is used alongside the SDK method.

  • GetUserProfile — gets data from the user’s public profile. The Get user public profile API call is used alongside the SDK method.

  • SearchUsersByNickname — searches for the user by nickname. The Search users by nickname API call is used alongside the SDK method.

  • LinkSocialNetworkToUserAccount — links the user account and a social network that the player uses for authentication. The Get URL to link social network to account API call is used alongside the SDK method.

  • UpdateLinkedSocialNetworks — updates the user’s social networks data. The Get linked networks API call is used alongside the SDK method.

Implementing a friends system for social networks

To let users interact with friends from social networks in your application, configure the storage of friend data on the Xsolla side:

  1. Go to your Publisher Account.
  2. Click Open in the Login block and go to Login projects.
  3. Click Open and set up in the Login project block.
  4. Go to General settings > Authentication.
  5. Set the Store friends from social networks toggle to On.
  6. Save changes.

To make friends from the social network available to the player in the application, implement the following logic in your application:

  1. Link a social network to a player’s account using the LinkSocialNetworkToUserAccount method. The Get URL to link social network to account API call is used alongside the SDK method.
  2. Update your friends list using the UpdateUsersFriends method. The Update social account friends API call is used alongside the SDK method.
  3. Get a list of friends from a linked social network using the UpdateSocialFriends method. The Get social account friends API call is used alongside the SDK method.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Hide
Last updated: July 30, 2021

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!