FAQs - Web Client SDK
RewardShop Module
How do I list reward-shop products?
getAllProducts({ page, limit, rewardType, ... }) returns a paginated list.
How do I fetch product details?
getProductById(id) returns a ProductType or null.
How does a player place an order?
Use playerPlaceRewardShopOrder(request) with recipient, language, shipping address, item, quantity, etc.
Can players subscribe for “back in stock” alerts?
Yes—subscribeToProductAvailability(productId), and check status via isPlayerSubscribedToProductAvailability(productId).
How do I get custom fields for the order form?
getOrderFormCustomFields() returns admin-configured custom fields to render in your UI.
Can I paginate player orders?
Yes—getPlayerOrders({ page, limit, status, rewardType, sortBy }).
Rewards Processor Module
How does a player claim grouped rewards?
Call playerClaimRewardsByGroupId(groupId) to claim rewards for a given group.
Catalog Module
How do I list casino game categories?
getCasinoGameCategories() returns all categories (cached with graceful stale fallback on API failure).
How do I search/paginate games?
getCasinoGames({ page, limit, idOrName, gameName, gameId, gameProvider, gameCategory }) returns a PaginationResponse<GameType[]>.
How do I list game providers?
getCasinoGamesProviders() returns the available providers (with caching).
Feature Flags Module
How do I read a feature flag?
Use getFeatureFlagValue(key); returns the typed value or null if not found.
Is there a bulk fetch for all flags?
getFeatureFlags() exists but is deprecated; prefer getFeatureFlagValue.
Are flag values cached?
Yes—values are cached in IndexedDB for ~30 minutes and cleared on closeSession().
CRM (Notifications)
How do I register a player for Web Push?
Call Crm.playerRegisterWebPushSubscription(); the SDK checks support/permissions and returns a status enum.
What statuses can Web Push registration return?
SUCCESS, ALREADY_GRANTED, MISSING_SERVICE_WORKER, WEB_PUSH_NOT_SUPPORTED, WEB_PUSH_PERMISSION_DENIED, WEB_PUSH_PERMISSION_CANCELLED, ERROR.
How do I decide when to show the permission banner?
Use shouldShowNotificationRequestPermissionsBanner(days, override) to throttle prompting (especially useful for Safari).
Do I need a service worker for Web Push?
Yes—host a minimal service worker that imports the Gamanza script from your PEP CDN domain.
How do I register for OneSignal in-app notifications?
Send a OneSignalInAppNotificationSubscription to playerOneSignalInAppPushNotificationsSubscription(...).
Real-Time Events (RTM)
How do I subscribe to real-time events (e.g., XP up/level up)?
Events.subscribe(eventKey, callback, options) returns a subscription ID; options include once, timeout, and filter.
How do I unsubscribe?
Use Events.unsubscribe(id) for one subscription or Events.unsubscribeFromEvent(eventKey) to remove all for that key.
Can I see current subscription stats?
Yes—Events.getEventsStats() returns a summary object.
Errors, Responses & Types
What’s the standard success/error envelope?
Many methods return SimpleResponse<T> with { ok, data, error? }; lists use PaginationResponse<T> with totals and paging.
What’s the most common initialization pitfall?
Accessing modules before init()—guard for SDKNotInitializedException and ensure init() resolves before calling getInstance().
Performance & Caching
Does the SDK cache data?
Yes—some modules (e.g., Missions, Catalog, FeatureFlags) employ caching and can return stale data when APIs fail, improving resilience.
Versioning & Licensing
Where can I see the current version and changelog?
Check the NPM package page; it shows the published version and metadata.
What’s the license model?
The SDK is proprietary; usage is governed by the Gamanza Engage SDK License (see package license notes).
Additional Questions
How do Operators load the v2 widgets bundle?
Operators should include the v2 script from their region CDN, then call GamanzaEngageClient.init(config, cb). Use getInstance(cb) later to safely access GamificationWidgets.
What happens if Operators call getInstance before init finishes?
The callback receives null; Operators should implement a fallback to (re)call init or postpone usage.
How do Operators render widgets in SPA routes that mount DOM nodes later?
Operators should use GamificationWidgets.reload() (or reloadOne(id)) after new nodes appear so the library scans and attaches widgets.
What DOM structure do widgets expect?
Widgets expect elements with the class gamification_widget and a data-type such as avatar, reward-shop, active-boosters, etc.
How can Operators get the current player basics, such as opt-in, from the SDK?
Operators can use GamificationWidgets.getPlayer(cb) (exposed via getInstance) and listen for the GamanzaEngage_Client_Initialized event to know when the initial fetch has finished.
What is the clean-up hook on logout?
Operators should call GamificationWidgets.destroyWidgets() to clear Redux, local storage, socket connections, and tear down the instance.
Is v1 of the client still supported?
No, v1 is deprecated; Operators should use the v2 bundle and APIs.
Do the widgets provide real-time updates?
Yes, the frontend gateway and widgets leverage SocketIO to deliver player progress and notification updates once authenticated.
Can Operators localize widget labels dynamically?
Yes, Operators can re-render widgets with reload(newLocale) or reloadOne(id, newLocale) after updating the locale in their app state.
60. What is the minimal markup to show active boosters?
<div class="gamification_widget" data-type="active-boosters"></div> (after initialization).
Last updated
Was this helpful?

