Configure SDK
This script integrates the THNDR SDK into your web app, enabling secure communication between your parent window and the embedded game.
All interactions with your users balances are made via server to server APIs
Below is a brief overview of the callbacks and configuration.
Configuration
Pass in the following query params into the game url to configure the app.
operatorId
: This ID will be provided to you by THNDRgameId
: 'solitaire', 'blocks' or 'blackjack'language
: Two-letter country code. If language is not supported, defaults to English.
Note: for game make sure clipboard permissions are allowed:
Callbacks
The SDK requires two key callback functions, each responsible for handling specific actions within the THNDR game.
getToken
Returns the authentication token for the user.
getBalance
Retrieves the user's balance from your system and return it to the THNDR game for display.
handlePaymentError
When a payment request fails, your integration should return one of the following error-handling responses. These responses determine what the user will see within the game and how the system behaves next.
Use this option to instruct the system to retry the payment. No additional popups will appear unless the retry attempt also fails. If it does, a generic payment error will be displayed.
This will immediately display a standard error popup to the user. Use this if the error cannot be recovered from or if retrying is not applicable.
Use this to display a custom error message to the user. This is useful when you want to show specific messaging, such as account-related issues or detailed failure reasons.
Use this to not retry the payment. Also no error message will be shown
analyticsEvent
Returns events that occur in the game, should it be required to capture these for your own analytics
close
The host application should close the web view hosting the game. This means the user indicated they want to close the game.
Example Code Overview
The code integrates the THNDR SDK with the specified configuration and callbacks:
Last updated