auth

Playtech.API. auth

Members

# (static) isLoggedIn

Example
Playtech.API.auth.isLoggedIn;

Methods

# (static) addAfterCredentialsLoginCallback(callback)

Add callback after login with credentials.
Parameters:
Name Type Description
callback function (resolve, reject) => {...}
Example
Playtech.API.auth.addAfterCredentialsLoginCallback((resolve, reject) => setTimeout(() => resolve(), 2000));

# (static) addBeforeRegistrationHook(callback)

Add callback to modify the data that is sent to IMS during registration. It must return all arguments that it was given.
Parameters:
Name Type Description
callback function (dataMap) => {... return { dataMap }} dataMap from registration form
Example
Playtech.API.auth.addBeforeRegistrationHook(({ dataMap }) => {
    // modify phone right before registration request is sent
    dataMap.phone = '+123';

    return { dataMap };
});

# (static) getFitToPlaySubmissionRequired() → {boolean}

Get whether fitToPlaySubmissionRequired is set to '1'.
Returns:
Type
boolean
Example
Playtech.API.auth.getFitToPlaySubmissionRequired();

# (static) getTemporaryAuthenticationToken(serviceTypeopt) → {Promise.<string>}

Get temporary authentication token for logged in user.
Parameters:
Name Type Attributes Default Description
serviceType string <optional>
GamePlay
Returns:
Type
Promise.<string>
Example
Playtech.API.auth.getTemporaryAuthenticationToken();

# (static) getTwoFactorConfiguration() → {Promise.<{Object}>}

Get Two Factor configuration data. Ims docs.
Returns:
{ twoFactorConf: { enabled: boolean, loginDeviceSupported: boolean, rememberMeRequirePin: string, rememberMeWithoutTwoFactor: ('ON' | 'OFF'), rememberMeExpirationSec: number, loginDeviceExpirationSec: number, defaultChannel: string, onlyNumbers: boolean, unblockTokenExpirationSec: number, configuredServices: { service: string, option: ('ON' | 'OFF') }[], excludedClientTypePlatforms: { clientType: string, clientPlatform: string }[] }}
Type
Promise.<{Object}>
Example
Playtech.API.auth.getTwoFactorConfiguration().then(data => {...});

# (static) login(userName, password, rememberMeLoginopt) → {Promise.<void>}

Performs login.
Parameters:
Name Type Attributes Default Description
userName string
password string
rememberMeLogin boolean <optional>
false
Returns:
Type
Promise.<void>
Example
Playtech.API.auth.login('test2145', 'Password1!').then(() => {...});

# (static) logout(isQuietopt) → {Promise.<void>}

Parameters:
Name Type Attributes Description
isQuiet boolean <optional>
Returns:
Type
Promise.<void>
Example
Playtech.API.auth.logout().then(() => {...});

# (static) register(dataMap, addressDetailsopt, contactAddressopt, depositLimitsopt, betLimitsopt, betLimitsActionopt, lossLimitsopt, lossLimitsActionopt, contactPreferencesopt, tagsopt, tokenopt, blackboxopt) → {Promise.<{playerCode: number, userId: string, actions: Object}>}

Create new player. see ims docs
Parameters:
Name Type Attributes Description
dataMap Object see ims docs.
addressDetails Object <optional>
see ims docs.
contactAddress Object <optional>
see ims docs.
depositLimits Object <optional>
see ims docs.
betLimits Object <optional>
see ims docs.
betLimitsAction string <optional>
Values: 'logout', 'message'.
lossLimits Object <optional>
see ims docs.
lossLimitsAction string <optional>
Values: 'logout', 'message'.
contactPreferences Object <optional>
Properties
Name Type Attributes Description
channel string <optional>
Values: 'email', 'phone', 'SMS', 'mobilePush', 'internalMessage', 'desktopCompanion', 'whatsApp', 'directMail'.
type string <optional>
Values: 'promotional', 'account', 'thirdParty'.
preference boolean <optional>
isInvalid boolean <optional>
True if channel is marked as invalid.
tags Array.<Object> <optional>
Properties
Name Type Attributes Description
name string <optional>
value string <optional>
Values: 'text', 'number', 'date', 'delta'
type string <optional>
comment string <optional>
expirationDate string <optional>
Format: yyyy-MM-dd 2016-04-13.
token string <optional>
Challenge-response token.
blackbox string <optional>
Examples: SomestringForIOBB
Returns:
For actions type see ims docs.
Type
Promise.<{playerCode: number, userId: string, actions: Object}>
Example
Playtech.API.auth.register({
      dataMap: {
          casinoName: 'playtech800075',
          clientSkin: 'playtech800075',
          title: 'Mr',
          firstname: 'test',
          lastname: 'test',
          sex: 'M',
          email: 'test2145@playtech.com',
          birthdate: '1986-01-01',
          countrycode: 'UA',
          state: 'Kyiv',
          city: 'Kyiv',
          zip: '01001',
          cellphone: '+38022112211',
          phone: '+380',
          address: 'svoboda street',
          userName: 'test2145',
          password: 'Password1!',
          verificationQuestion: 'test',
          verificationAnswer: 'test',
          currencyCode: 'GBP',
          coupon: '',
          advertiser: 'advertiser',
          clientPlatform: 'web',
          signupDeviceType: 'other',
          signupOsName: 'macintosh',
          signupOsVersion: 'x',
          signupDeliveryPlatform: 'Hub2',
          signupDeviceBrowser: 'chrome',
          language: 'EN',
          serial: '460916c7-bd41-42a8-ac82-d85a55924547',
          signupDeviceId: '460916c7-bd41-42a8-ac82-d85a55924547',
          clientType: 'casino'
      },
      contactPreferences: {
          channel: 'email',
          type: 'promotional',
          preference: false
      },
      addressDetails: {
          buildingName: 'My Building',
          buildingNumber: '1',
          subbuilding: '1',
          streetName: 'Sportivnaya',
          streetNumber: '1',
          propertyName: '-',
          propertyNumber: '12',
          suburb: 'Kyiv'
      },
      contactAddress: {
          city: 'Kyiv',
          countryCode: 'UA',
          zip: '01012'
      }
}).then(data => {...});

# (static) showLogin()

Show login page or login popup.
Example
Playtech.API.auth.showLogin();

# (static) showLoginPopup(onCloseopt, onLoginopt, titleopt)

Shows login popup.
Parameters:
Name Type Attributes Description
onClose function <optional>
Callback on close popup
onLogin function <optional>
Callback on login
title string <optional>
Title of popup
Example
Playtech.API.auth.showLoginPopup({ onClose: (event) => {...}, onLogin: () => {...}, title: 'Login' });