Managing the collection of user data
How it works
During user registration, the following basic data is requested:
- When using the Login API:
- username
- password
- When using the Login widget:
- password
You can request additional personal data from users. To do this, in your Publisher Account, specify which additional fields should be included in the registration form. User registration is possible only after filling in all the fields that you have marked as mandatory. The data provided by users is stored in their profiles in the database.
If, during authentication of a previously registered user, it is found that some fields in their profile are not filled in, the Login product will display a form to collect the missing information. To log in, the user needs to fill in all the required fields of this form.
How to get it
- Set up your Login project in Publisher Account.
- Send a request to your Account Manager to include your custom fields to the user registration form (optional).
- Integrate the solution on the side of your application.
Setting up in Publisher Account
- Open your project in Publisher Account and go to the Login section.
- Click Configure in the pane of a Login project.
- On the navigation page, go to the User database block and select the Supplementary user information section.

- Choose what user information you want to collect. The following fields are available:
- Username
- First name
- Last name
- Birthdate
- Country
- Gender
- To make a field mandatory, click the ★ icon in the field description line. The icon will turn blue.
- Click Save changes.
Request to add custom fields to registration form
In addition to the fields available in the Publisher Account, you can add your own fields to the registration form. To do this, contact your Account Manager (or write to am@xsolla.com) and provide the list of fields with the following information for each field:
- field name in English;
- type:
string
;date
;select
— selecting one option from a list;multi-select
— selecting multiple options from a list;
- whether the field is mandatory.
For select
and multi-select
fields, also provide your Account Manager with sets of possible values for these fields.
Application side integration
If you have used the integration via the Login widget, no actions are required to integrate the extended registration form on the side of your application.
When integrating through the Xsolla SDK, collecting additional information about users is not yet available.
When integrating via the Login API, pass the collected additional user data in the Register new user request using the fields
parameter. This parameter is a set of property-value pairs. The fields of the registration form that can be connected in the Publisher Account correspond to the following properties of the fields
parameter:
Field name | Type | fields parameter property |
---|---|---|
Username | string | username |
First name | string | given-name |
Last name | string | family-name |
Birthdate | date (YYYY-MM-DD) | bday |
Country | select (ISO 3166-1 alpha-2) | country-name |
Gender | enum (with f and m values) | gender |
Example of the request:
- http
- curl
POST https://login.xsolla.com/api/user?login_url=https://example.com&projectId={projectId} HTTP/1.1
Content-Type: application/json
{
"username": "john-email@email.com",
"password": "123456",
"email": "john-email@email.com",
"fields": {
"nickname": "John",
"country-name": "US",
"bday": "1997-07-16"
}
}
curl --request POST \
--url 'https://login.xsolla.com/api/user?login_url=https%3A%2F%2Fexample.com&projectId=projectId' \
--header 'content-type: application/json' \
--data '{"username":"john-email@email.com","password":"123456","email":"john-email@email.com","fields":{"nickname":"John","country-name":"US","bday":"1997-07-16"}}'
The options for adding fields to the registration form and the location for storing the collected information differ depending on the type of user data storage chosen:
Xsolla storage
If you use Xsolla storage, you can only add fields available in your Publisher Account to the registration form. The additional information collected from users is stored on Xsolla’s side.
PlayFab storage
If you use PlayFab storage, you can add both fields available in your Publisher Account and your own fields to the registration form.
Information about additional fields and their values are saved as user data in your PlayFab storage. You can access this user data through the PlayFab API or in your PlayFab account:
- Go to the Players section and click the user ID.
- Select the Player Data (Title) tab.
Firebase storage
If you use Firebase storage, you can add both fields available in your Publisher Account and your own fields to the registration form. The additional information collected from users is stored on Xsolla’s side.
Custom storage
If you use a custom storage, you can add both fields available in your Publisher Account and your own fields to the registration form.
Information about additional fields and their values are sent by the Xsolla Login server in the registration request to the URL that was specified in the New user URL field in the Publisher Account when connecting your custom storage.
Example:
The following fields are added to the user registration form:
- country;
- custom
nickname
field ofstring
type; - custom
platform
field ofmulti-select
type with possible values:windows
,mac os
, andlinux
.
During user registration, the Xsolla Login server will send the following request to the New user URL:
- http
- curl
POST https://your.hostname/new_user_url.path HTTP/1.1
Content-Type: application/json
Authorization: Bearer {JWT}
{
"email": "john@gmail.com",
"password": "123456",
"country-name": "DE",
"nickname": "JohnSnow",
"platform": ["windows", "mac os"]
}
curl --request POST \
--url 'https://your.hostname/new_user_url.path' \
--header 'authorization: bearer_JWT' \
--header 'content-type: application/json' \
--data '{"email":"john@gmail.com","password":"123456","country-name":"DE","nickname":"JohnSnow","platform":["windows","mac os"]}'
Was this article helpful?
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.