RGS Frontend Integration
General
The RGS frontend is provided as a responsive iframe which is optimized for desktop and mobile platforms.
The iframe's URL (game launch URL) accepts a set of parameters that specify configuration options. Available parameters will be explained in the section Launching the Game.
Once instantiated, the iframe will look like this (desktop environment left and mobile environment right):

Launching the game
Virtual Sports
Virtual Sports will launch with our built-in navigation. The structure of the game launch URL is as follows:
Below you will find a list of valid game launch URL parameters:
clientId
required
Identifies you as a bookmaker in our system. The id will be provided to you by your technical account manager.
lang
required
Specifies a player's language used on the host website (ISO 639-1 specification).
product
required
Specifies the game to be launched in our built-in navigation component. Please refer to the provided list of products enabled for you in our system.
id
optional
User session/authentication token generated by your platform. The token will be passed inside of requests to your wallet for user verification on your end.
If this parameter is omitted the game will be launched in anonymous mode which will allow market selection and ticket calculation, but will prevent users from placing bets. The user will see the message Login to place bets on the bet slip. Clicking the message will trigger a postMessage to the host page. You can read more about this in section postMessage Communications.
See also section User Session Handling for further details.
do
optional
Specifies the odds display format. The parameter does not have impact on how odds are calculated and only triggers a simple conversion from decimal odds to the specified odds format. If this is not specified, the default odds format will be decimal.
currency
optional
Specifies the currency used on the host website while in anonymous mode. If not provided, the default currency configured for your clientId will be used. If the user is logged in with a valid session token then the currency that is returned with the registration request will be used.
A list of supported currencies can be found in the Appendix.
style
optional
If needed, your technical account manager will provide you with a style parameter. If not provided, the default style will be applied and there is no further action needed from your side.
refId
optional
If provided, this value will be used to log into a specific wallet in case multiple wallets have been configured for your clientId.
Parameters are case sensitive and values must be in lower case. The order of the parameters does not matter and any additional parameters will be ignored on our side.
3rd party games
Launching 3rd Party Games is slightly different to launching our Virtual Sports as 3rd Party Games do not come with a built-in navigation component.
Our 3rd Party Games launcher is designed to open a single game via a direct link so you can embed the products into your existing game lobby easily.
In essence, the launch URL for a 3rd party game has the same structure as the launch URL for our Virtual Sports. However, there are one additional parameter (compositionId) and one other (product) that needs to be treated differently. Please see an example below:
Below you will find the descriptions for the URL parameters specific to 3rd party games:
compositionId
required
Specifies a particular 3rd party game.
A list of 3rd party games available to will be provided by one of our integration specialists during integration.
product
required
Always index for 3rd party games.
lobbyUrl
Optional
A URL which can be used to navigate to an operator’s game lobby from within a game.
Not supported by every content provider.
funMode
Optional
Specifies if a game should launch in demo or real mode.
Not supported by every content provider.
jurisdiction
Optional
Specifies a players jurisdiction.
Not supported by every content provider.
brand
Optional
Can be used to specify an operator’s brand if applicable.
Not supported by every content provider.
Alongside the launch URLs, one of our integration specialists will provide you with graphical asset you can use as icons, thumbnails etc. in your existing game lobby.
User session handling
This section describes ways to handle user sessions in our system.
Registering a user
In order for a player to place bets, you must pass a token to the game launch URL as the parameter id. This id can be whatever string, but it must uniquely identify a user. The token should not be reused over time.
Our system will take care of the user registration transparently.
Keeping the session alive
After initial user registration, the session has a lifespan of 1 minute, but it can be extended by 1 hour at a time indefinitely. The RGS frontend takes care of this upon initialization and keeps the session open automatically as long as the page stays open by polling the backend at regular intervals.
If the backend returns a session expired message, the user will be notified and the Place bet button will revert to the non-logged-in state. You can read more about this in section postMessage communication.
Unregistering a user
When a user logs out of the host website, it is advisable to close the user session on our side as well. If no action is taken during logout, the session will expire after 1 hour in our system.
To unregister a user proactively, the following request can be made:
Unregister Request
Unregister Request URL Parameters
key
required
Specifies a unique bookmaker API key provided by Sportradar.
token
required
Specifies the token during login of the particular user.
Unregister Response
If the backend is able to respond, the response code will always be 200. Please check the statusCode property of the response to make sure it is 0 (no error). The response also contains an errors array in case something went wrong. Otherwise, the response body can be found in the data property.
postMessage communication
postMessage communicationThe RGS frontend will communicate with your page via postMessage in three cases: Anonymous user trying to place a bet, bet placed, and height of the application changes. While you can ignore them, it is highly recommended to trigger specific actions in response to these notifications, as outlined below.
Anonymous user bet place — BWG_anonymousUserBetPlace
BWG_anonymousUserBetPlaceThis message is sent when an anonymous user (not logged in) clicks on the Place bet button (it reads “Login to place bets”). This allows the you to display a login form above the iframe or handle the situation as you see fit. For example, if the user is logged into your system but not in ours, you can reload the iframe and pass the user token as id in the URL.
Payload of BWG_anonymousUserBetPlace
BWG_anonymousUserBetPlaceBet placed event — BWG_betslipPlaced
BWG_betslipPlacedThis event is triggered when the user successfully places a ticket. It is supposed to notify the bookmaker that a bet has been placed and that the user's balance should be updated.
The payload contains the submitted ticket(s) merged with a response from the server. If the ticket is not placed, no message is sent.
Payload of BWG_betslipPlaced
BWG_betslipPlacedSet iframe height event
iframe height eventPlease note: The following method only works for the desktop version of RGS. If you want to set the height in the mobile integration, please see section iframe Integration in mobile for further details.
This event is triggered on initial load of the application or whenever the height of the application updates.
The payload contains the current height of the application. Setting the iframe height dynamically according to the received data will keep the iframe height equal to the height of the application within the iframe.
Payload of setIframeHeight
setIframeHeightCustomer integration example
The customer must instantiate a postMessage listener following this example.
This snippet is just an example. Please implement a solution that fits your needs.
Warning: It is important to check that the message is sent by the expected origin.
iframe integration in mobile
iframe integration in mobileWhen integrating our responsive UI in an mobile environment, you must give the iframe a set height to ensure smooth bet slip navigation.
Please see the following examples for further details:
This can also be styled via CSS.
Appendix
Supported Currencies
Afghanistan
Afghani
afn
Albania
Lek
all
Algeria
Algerian Dinar
dzd
Angola
Kwanza
aoa
Argentina
Argentine Peso
ars
Armenia
Armenian Dram
amd
Aruba
Aruban Florin
awg
Australia
Australian Dollar
aud
Azerbaijan
Azerbaijanian Manat
azn
Bahamas
Bahamian Dollar
bsd
Bahrain
Bahraini Dinar
bhd
Bangladesh
Taka
bdt
Barbados
Barbados Dollar
bbd
Belarus
Belarussian Ruble
byn
Belize
Belize Dollar
bzd
Bermuda
Bermudian Dollar
bmd
Bhutan
Ngultrum
btn
Bolivia, Plurinational State Of
Boliviano
bob
Bosnia And Herzegovina
Convertible Mark
bam
Botswana
Pula
bwp
Brazil
Brazilian Real
brl
Brunei Darussalam
Brunei Dollar
bnd
Bulgaria
Bulgarian Lev
bgn
Burundi
Burundi Franc
bif
Cambodia
Riel
khr
Canada
Canadian Dollar
cad
Cape Verde
Cape Verde Escudo
cve
Cayman Islands
Cayman Islands Dollar
kyd
Central African States
CFA Franc BEAC
xaf
Chile
Chilean Peso
clp
China
Yuan Renminbi
cny
Colombia
Colombian Peso
cop
Comoros
Comoro Franc
kmf
Congo, The Democratic Republic Of
Congolese Franc
cdf
Costa Rica
Costa Rican Colon
crc
Croatia
Croatian Kuna
hrk
Cuba
Peso Convertible
cuc
Cuba
Cuban Peso
cup
Czech Republic
Czech Koruna
czk
Denmark
Danish Krone
dkk
Djibouti
Djibouti Franc
djf
Dominican Republic
Dominican Peso
dop
East Caribbean
East Caribbean Dollar
xcd
Egypt
Egyptian Pound
egp
El Salvador
El Salvador Colon
svc
Estonia
Estonian Kroon
eek
Eritrea
Nakfa
ern
Ethiopia
Ethiopian Birr
etb
European Union
Euro
eur
Falkland Islands (Malvinas)
Falkland Islands Pound
fkp
Fiji
Fiji Dollar
fjd
French Pacific
CFP Franc
xpf
Gambia
Dalasi
gmd
Georgia
Lari
gel
Ghana
Ghana Cedi
ghs
Gibraltar
Gibraltar Pound
gip
Guatemala
Quetzal
gtq
Guinea
Guinea Franc
gnf
Guyana
Guyana Dollar
gyd
Haiti
Gourde
htg
Honduras
Lempira
hnl
Hong Kong
Hong Kong Dollar
hkd
Hungary
Forint
huf
Iceland
Iceland Krona
isk
India
Indian Rupee
inr
Indonesia
Rupiah
idr
Iran, Islamic Republic Of
Iranian Rial
irr
Iraq
Iraqi Dinar
iqd
Israel
New Israeli Sheqel
ils
Jamaica
Jamaican Dollar
jmd
Japan
Yen
jpy
Jordan
Jordanian Dinar
jod
Kazakhstan
Tenge
kzt
Kenya
Kenyan Shilling
kes
Korea, Democratic People’s Republic Of
North Korean Won
kpw
Korea, Republic Of
Won
krw
Kuwait
Kuwaiti Dinar
kwd
Kyrgyzstan
Som
kgs
Lao People’s Democratic Republic
Kip
lak
Latvia
Latvian Lats
lvl
Lebanon
Lebanese Pound
lbp
Lesotho
Loti
lsl
Liberia
Liberian Dollar
lrd
Libya
Libyan Dinar
lyd
Lithuania
Lithuanian Litas
ltl
Macao
Pataca
mop
Macedonia, The Former Yugoslav Republic Of
Denar
mkd
Madagascar
Malagasy Ariary
mga
Malawi
Kwacha
mwk
Malaysia
Malaysian Ringgit
myr
Maldives
Rufiyaa
mvr
Mauritania
Ouguiya
mro
Mauritius
Mauritius Rupee
mur
Mexico
Mexican Peso
mxn
Moldova, Republic Of
Moldovan Leu
mdl
Mongolia
Tugrik
mnt
Morocco
Moroccan Dirham
mad
Mozambique
Mozambique Metical
mzn
Myanmar
Kyat
mmk
Namibia
Namibia Dollar
nad
Netherlands Antillean
Netherlands Antillean Guilder
ang
Nepal
Nepalese Rupee
npr
New Zealand
New Zealand Dollar
nzd
Nicaragua
Cordoba Oro
nio
Nigeria
Naira
ngn
Norway
Norwegian Krone
nok
Oman
Rial Omani
omr
Pakistan
Pakistan Rupee
pkr
Panama
Balboa
pab
Papua New Guinea
Kina
pgk
Paraguay
Guarani
pyg
Peru
Nuevo Sol
pen
Philippines
Philippine Peso
php
Poland
Zloty
pln
Qatar
Qatari Rial
qar
Romania
New Romanian Leu
ron
Russian Federation
Russian Ruble
rub
Rwanda
Rwanda Franc
rwf
Saint Helena, Ascension And Tristan Da Cunha
Saint Helena Pound
shp
Samoa
Tala
wst
Sao Tome And Principe
Dobra
std
Saudi Arabia
Saudi Riyal
sar
Serbia
Serbian Dinar
rsd
Seychelles
Seychelles Rupee
scr
Sierra Leone
Leone
sll
Singapore
Singapore Dollar
sgd
Solomon Islands
Solomon Islands Dollar
sbd
Somalia
Somali Shilling
sos
South Africa
Rand
zar
South Sudan
South Sudanese Pound
ssp
Sri Lanka
Sri Lanka Rupee
lkr
Sudan
Sudanese Pound
sdg
Suriname
Surinam Dollar
srd
Swaziland
Lilangeni
szl
Sweden
Swedish Krona
sek
Switzerland
Swiss Franc
chf
Syrian Arab Republic
Syrian Pound
syp
Taiwan, Province Of China
New Taiwan Dollar
twd
Tajikistan
Somoni
tjs
Tanzania, United Republic Of
Tanzanian Shilling
tzs
Thailand
Baht
thb
Tonga
Pa’anga
top
Trinidad And Tobago
Trinidad and Tobago Dollar
ttd
Tunisia
Tunisian Dinar
tnd
Turkey
Turkish Lira
try
Turkmenistan
Turkmenistan New Manat
tmt
Uganda
Uganda Shilling
ugx
Ukraine
Hryvnia
uah
United Arab Emirates
UAE Dirham
aed
United Kingdom
Pound Sterling
gbp
United States
US Dollar
usd
Uruguay
Peso Uruguayo
uyu
Uzbekistan
Uzbekistan Sum
uzs
Vanuatu
Vatu
vuv
Venezuela, Bolivarian Republic Of
Bolivar
ves
Vietnam
Dong
vnd
West African States
CFA Franc BCEAO
xof
Yemen
Yemeni Rial
yer
Zambia
Zambian Kwacha
zmw
Zimbabwe
Zimbabwe Dollar
zwl
Last updated
Was this helpful?