# Games integration

This integration is only required if you are a gaming provider that wants to be listed in DeBets in order to let users discover and play your games on DeBets website. As already explained, for this use case you are also requested to integrate DeBets Seamless Server.

For the other use case of DeBets, which consists in using it as a payment solution for your gambling website, the games integration does not apply and you can skip this page. You are instead required to integrate DeBets Client App in your website.

# Game connector

When your games are launched and played in DeBets website some sort of interaction between DeBets Client App and the games is needed. More specifically DeBets Client App needs to:

  • be notified when the game loading is complete (game ready event)
  • be notified any time a bet is placed (start of a new game round)
  • be able to request the game to update its balance (send a balance update request to its game server)

For this purpose you are required to include an external javascript file provided by DeBets in the web page that embeds your games. This will load DeBets Game Connector module which acts as an interface between your games and DeBets Client App, satisfying all the aforementioned requirements.

The <script> to include DeBets Game Connector module looks like this:

<script id="debets"
    src="https://app.debets.io/debets-game-connector.js"
    data-provider="eagaming" data-session-id="TK4484534" data-game-id="71">
</script>

In the <script> tag above the value for data-provider attribute must be set to the username that DeBets as assigned to you. You will receive your username after enrolling, it will be communicated to you in the dedicated Signal group that DeBets will create.
DeBets uses the data-provider attribute to load the correct module specifically for your games. DeBets needs your support in order to implement the module. The following options are possible:

  • use Javascript API provided by your games if any
  • hooking into your games code
  • intercepting HTTP requests made by your games

The best option will be chosen according to your input.

If you have different game types or more generally your games are based on different game clients, it might be required to interact with your games in different ways based on the game type or the game client. In this case you are required to use the game-type attribute in the <script> tag providing a value that allows DeBets to act differently depending on the game type or game client.

What follows is the complete list of attributes that can be specified in the <script> tag and their meaning:

attribute name required description
data-provider username that uniquely identifies the game provider in DeBets
data-session-id ID of the game session. It must match the value sent for sessionId in seamless requests
data-game-id ID of the game. It must match the value sent for gameId in seamless requests
data-game-name name of the game (this is used when listing the game on DeBets Website). See Games configuration
data-game-type a string that represents the game type. This is used by DeBets to disintiguish between different game types or different game clients in the implementation of the game connector module
data-game-tags defines a list of tags associated to the game. Tags are used to categorize the games in DeBets Website. See Games configuration
data-provably-fair must be set to "true" if the game supports Provably Fair

# Launching Games

For your games to be launchable on DeBets website you have to provide an API that returns the URL to open the game. This API will be called with the following parameters:

  • ID of the game that the user wants to launch. See Games configuration.
  • ID of the gaming account to be used when playing the game (or an external ID that represents the gaming account in your game server).
  • player address: this is the address of the wallet that the player has connected to DeBets

The flow to launch games from DeBets Website is the following:

  • the user clicks on the desiredd game and selects the cryptocurrency that will be used to play it among the available ones
  • DeBets will call the above API, passing it the player address, the ID of the chosen game and the ID of the gaming account that corresponds to the selected cryptocurrency
  • the API returns the URL to launch the game
  • DeBets opens the URL in a IFRAME

# Play for fun

Play-for-fun is an optional feature on DeBets that may choose to support. In that case you have to provide an additional API, similar to the API used to launch games, that allows DeBets to launch the game in play-for-fun mode.

# Game configuration

DeBets maintains the list of your games on its side. In DeBets Games are represented by the following properties:

  • gameId: ID that you assigned to your game
  • name: name of the game
  • type: this is a string value that is used by DeBets Game Connector to distinguish games in terms of game type and interoperate with games accordingly. You normally use different game types when your games are based on different game clients or game types and this impacts the integration with the Game Connector
  • disabled: boolean flag. When set to true DeBets will not allow to play the game (deposit activation fails for games that are disabled)
  • hidden: boolean flag that determines whether or not the game is shown in Debets website. Hidden games do not appear on the game list and cannot be discovered by users.
  • verified: boolean flag that indicates whether or not the game has been verified by DeBets (Games verification)
  • provablyFair: boolean flag that indicates whether or not the game supports Provably Fair
  • buttonBgColor: background color of the game launch button that DeBets will use to display the game in the games list if you don't set any launch button image for the game

In addition to the above properties DeBets also lets you assign tags to your games.

DeBets allows you to add games and edit their configuration in two ways:

  1. calling the Game API provided by DeBets
  2. from the Game Configuration section of the Backoffice

Instead of manually creating all your games in DeBets Backoffice (which requires setting properties like gameId and name for each game) you may choose to add and configure your games programmatically. You can do this by using DeBets GameAPI.

# Game tags

Each game can be assigned to multiple tags that you define. Users of Debets website can then filter your games list showing only the games that match the tags they have selected.
DeBets also allows you to mark two of your game tags as preferred. The preferred tags appear as labels on the bottom-left and bottom-right corners of the game launch button on games that have those tags.

Game with BUY BONUS and NEW preferred tags
Game with BUY BONUS and NEW preferred tags

As for the games configuration, you can edit the list of tags and add tags to your games either programmatically by using DeBets API or from the Backoffice.

# Games verification

Games do not appear on DeBets website until they are verified by DeBets.

The verified property of the game configuration is controlled by DeBets. Anytime you add a new game in DeBets its verified property is set to false.
DeBets takes care of checking that the game fully works and once the verification is successful it sets the game as verified. From this point the game will be visible to users of DeBets website and it will appear in your games list.