1.0.21 • Published 4 years ago

@quattro-bet/sportsbook-control v1.0.21

Weekly downloads
215
License
MIT
Repository
-
Last release
4 years ago

@quattro-bet/sportsbook-control

Install

npm i  @quattro-bet/sportsbook-control

or

yarn add  @quattro-bet/sportsbook-control

Usage

1. Add javascript file sportsbookControl.js from dist to your page:

<script src="https://domain.com/sportsbookControl.js"></script>

Or import sportsbookControl from node_modules:

import * as sportsbookControl from "@quattro-bet/sportsbook-control";

2. Call sportsbookControl.create():

/**
 * @param {Object} options
 * @return {Promise} Promise with the control object
 */
var promise = sportsbookControl.create(options);

Or via async/await:

async function foo() {
  var control = await sportsbookControl.create(options);
}

Options

NameTypeDescription
mountNodeHTMLElementNode to create a sportsbook
urlstringUrl to sportsbook
params
tokenstringPartner system player token may be omitted when a player is not logged
pagelive or preliveSportsbook page, default value is prelive
localetr_TR or en_USApplication locale, default value is tr_TR
mobilebooleanMobile or desktop version, default value is false
defaultCurrencystringThe default currency for unauthorized player, default value is EUR
timeZoneOffsetnumberTimezone offset in milliseconds, browser timezone by default

Controller methods:

changeParams(params: Object): void   - Change params.
destroy(): Promise<void>             - Destroy sportsbook application.

Login/logout

For login logout players use params.token.

For example, when you want to create an application but the user is not logged, you should omit a token filed. When the user will be logged call control::changeParams with token field.

 control.changeParams({token: "user_token"})

When the user logout, call change params with null.

 control.changeParams({token: null})

It's important to know that call control::changeParams with an empty object doesn't affect the application. If you want to delete some fields or a certain field, you should set its value equal to null.

Example:

var div = document.createElement("div");
document.body.appendChild(div);
    
var promise = sportsbookControl.create({
  mountNode: div,
  url: "https://bet.domain.com",
  params: {
    page: "prelive",
    token: "n3add69a9-f2c1-4029-ba3b-946a12263c4a",
    locale: "tr_TR"
  }
});
1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago