The player inventory contains the user’s items that they bought or received according to the game logic.
The inventory solution is based on the In-Game Store product. After a successful purchase, items are added to the player inventory automatically on the Xsolla side. To grant items without a purchase (for example, when reaching a certain level), use the Grant items to users API method in the back end of your application.
Users are identified via the authentication system based on the Login product. If you have configured your own authentication system, you can use a user JWT for client methods.
Implement the sale of virtual items and virtual currency outside the game via the store site. The purchased items and currency will be available in the player’s inventory.
To integrate your store site with the SDK:
- Create a store site.
- Specify the site address of the in-game store in the application code.
- Implement the logic for your application to work with the store site.
Create a store site
You can create a store site with Site Builder by following the instructions for connecting a store on the site.
If you want to connect a store site that was created using a different solution, follow the instructions for creating a store.
Recommendations for the logic for your application to work with the store site
Follow these recommendations when developing your application:
- Synchronize the fields of user registration and authorization in your application and in the Login widget on the store site:
- If a user email and password are used for registration and authorization, set the username equal to the email in the application.
- If you use a username, user email and password for registration and authorization, contact your Account Manager to change the Login widget fields.
- When navigating to the store site from the application client, implement pass-through user authorization. To do this, the user token must be passed in the URL parameters. An example of authorization is shown in the demo app.
Was this article helpful?
Found a typo or other text error? Select the text and press Ctrl+Enter.