Common customization scenarios
Set store localization
If you want to display the Xsolla Login widget and payment UI in the desired language depending on the region or user preferences, use the Locale
parameter. Supported values are listed in the Localization section.
Example:
- C#
1var config = new ReadyToUseStoreConfig
2{
3 Locale = "ja" // Japanese
4};
5XsollaReadyToUseStore.OpenStore(config);
Authenticate user with tokens
If you already have authorization tokens (e.g., obtained via Login API or SDK methods), you can pass them directly and not use the Xsolla Login widget.
Example:
- C#
1var tokenData = new TokenData
2{
3 accessToken = "...",
4 refreshToken = "...",
5 expirationTime = ...
6};
7var config = new ReadyToUseStoreConfig
8{
9 TokenData = tokenData
10};
11XsollaReadyToUseStore.OpenStore(config);
Embed store into your UI
You can place the store in a specific container of your UI instead of displaying it on the entire screen. For example, inside a panel, tab, or pop-up window.
Example:
- C#
1{
2 CatalogParent = yourTransform
3};
4XsollaReadyToUseStore.OpenStore(config);
Use custom UI components
You can override standard store elements (e.g., item cards) with your own prefabs. To do this:
- Create a component of the
MonoBehaviour
class that implements theICatalogItemWidget
interface. - Create a class that implements the
IPrefabsProvider
interface. This class should return your prefab for catalog items. - When calling the
OpenStore()
method, pass an instance of the created class to theprefabsProvider
parameter:
- C#
1public class MyPrefabsProvider : IPrefabsProvider
2{
3 public GameObject GetCatalogItemWidget() => myCustomItemPrefab;
4}
5
6XsollaReadyToUseStore.OpenStore(config, new MyPrefabsProvider());
Preload catalog images
You can speed up the catalog loading when there are a lot of items. To do this, when initializing the scene, before calling OpenStore()
, preload item images by calling the XsollaReadyToUseStore.WarmupCatalogImages()
method.
Found a typo or other text error? Select the text and press Ctrl+Enter.