User Account

How It Works

Your users can manage the following data via their account:

  • profile picture
  • phone
  • email
  • nickname
  • first and last name
  • date of birth
  • gender
  • friend list (available only via API).

You can integrate User Account in one of the following ways:

  • With an interface via URL. The User Account interface is localized into 20 languages and adjusts to the screen resolution.
  • Without an interface via API. This way you can implement your own interface for managing user data.

Who Can Use It

Partners who have already integrated Login.

How to Get It

Select the way in which you want to integrate User Account and follow the instructions below.

Integration via URL

  1. Generate a URL for opening User Account.
  2. Set up User Account opening at the generated URL.
  3. Set up events processing (optional).

URL Generation

User Account opens at https://useraccount.xsolla.com/profile with the parameters described in this table.

Parameter Type Description
locale string Query parameter. User Account interface language. Accepts values according to the ISO 639-1 standard.
token string Hash parameter. User JWT. Passed in the URL after successful authentication. Required.

Example of a URL:

https://useraccount.xsolla.com/profile?locale=de#token=XXXX

Setting up User Account Opening at URL

You can set up the opening of User Account at a particular URL in the following ways:

  • in an iframe on your website
  • in a new tab

IFRAME

Add the following script to the web page where you want to open User Account: <iframe src="https://useraccount.xsolla.com/profile?locale=ru#token=XXXX">, where src is the generated URL.

NEW TAB

Add a URL to the UI object that leads to User Account.

You can use the following script: <a href="https://useraccount.xsolla.com/profile?locale=ru#token=XXXX">Your account</a>, where src is the generated URL.

Setting up Events Processing (optional)

If the User account opens in an iframe, the parent window gets postMessage events according to user actions in the account.

Event name Description
user-account-close The user clicks the exit button and closes User Account.
user-account-loaded User Account is loaded, but the user data cannot be obtained.
user-account-page-fetched User Account and the user data are successfully loaded.

To process these events, add the addEventListener method and your script to the website.

Example of an event processing:

window.addEventListener('message', (event) => {
  if (event.data.command === 'user-account-loaded') {
    // your script
  }
})

Integration via API

To manage user data via API, implement your own interface and allow API methods calling. You will find the detailed description of available API methods and code examples in our documentation.