How to integrate 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).

Generate URL

User Account opens at https://useraccount.xsolla.com/profile with the parameters described in this table.
ParameterTypeDescription
locale
stringQuery parameter. User Account interface language.
Supported languages: English (en) (default), Arabic (ar), Bulgarian (bg), Czech (cs), German (de), Spanish (es), French (fr), Hebrew (he), Italian (it ), Japanese (ja), Korean (ko), Polish (pl), Portuguese (Brazil) (pt), Romanian (ro), Russian (ru), Thai (th), Turkish (tr), Vietnamese (vi), Chinese Simplified (cn), Chinese Traditional (tw).
token
stringHash parameter. User JWT. Passed in the URL after successful authentication. Required.
Example of a URL:
Copy
Full screen
Small screen
https://useraccount.xsolla.com/profile?locale=de#token=XXXX

Set 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&quot;&gt;Your account</a>, where src is the generated URL.

Set 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 nameDescription
user-account-closeThe user clicks the exit button and closes User Account.
user-account-loadedUser Account is loaded, but the user data cannot be obtained.
user-account-page-fetchedUser 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:

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

Integration via API calls

To manage user data via API, implement your own interface and allow API requests calling. You will find the detailed description of available API calls and code examples in our documentation.
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.
Rate this page
Rate this page
Is there anything we can improve?

Don’t want to answer

Thank you for your feedback!
Last updated: January 22, 2024

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!