Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Account

Contains all Requests regarding user/account and authentication

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns Account

Properties

config

config: ApiConfig

getToken

getToken: getToken = this.request.getToken

Retruns the OAuth token

method

getToken

example

InPlayer.Account.getToken()

returns

removeToken

removeToken: removeToken = this.request.removeToken

Removes the token

method

removeToken

example

InPlayer.Account.removeToken()

request

request: Request

setConfig

setConfig: (env: Env) => void

Type declaration

    • (env: Env): void
    • Parameters

      Returns void

setToken

setToken: setToken = this.request.setToken

Sets the Token

method

setToken

param
param
param
example

InPlayer.Account.setToken('344244-242242', '123123121-d1-t1-1ff',1558529593297)

Methods

changePassword

  • Changes password for a given user

    method

    changePassword

    async
    example
    InPlayer.Account
    .changePassword({
      oldPassword: 'old123',
      password: 'test123',
      passwordConfirmation: 'test123'
      brandingId: 1234
    },'123124-1r-1r13ur1h1')
    .then(data => console.log(data));

    Parameters

    • data: ChangePasswordData

      Contains { oldPassword: string password: string passwordConfirmation: string brandingId?: number }

    Returns Promise<AxiosResponse<void>>

deleteAccount

  • Deletes an account

    method

    deleteAccount

    async
    example
    InPlayer.Account.deleteAccount({
     password: "password",
     brandingId: 1234,
    })
    .then(data => console.log(data));

    Parameters

    • data: AccountAuthData

      Contains { password: string, brandingId?: number, }

    Returns Promise<AxiosResponse<CommonResponse>>

exportData

  • Exports account data to the users' email

    method

    exportData

    async
    example
    InPlayer.Account.exportData({
       password: "password",
       brandingId: 1234,
    })
    .then(data => console.log(data));

    Parameters

    • data: AccountAuthData

      Contains { password: string, brandingId?: number, }

    Returns Promise<AxiosResponse<CommonResponse>>

getAccountInfo

  • Gets the account information for a given auth token

    method

    getAccountInfo

    async
    example
    InPlayer.Account
    .getAccountInfo()
    .then(data => console.log(data));

    Returns Promise<AxiosResponse<AccountInformationReturn>>

getRegisterFields

  • getRegisterFields(merchantUuid: string): Promise<AxiosResponse<GetRegisterField>>
  • Gets register fields

    method

    getRegisterFields

    async
    example
    InPlayer.Account
    .getRegisterFields('123124-1r-1r13ur1h1')
    .then(data => console.log(data));

    Parameters

    • merchantUuid: string

      The merchant UUID

    Returns Promise<AxiosResponse<GetRegisterField>>

getSocialLoginUrls

  • getSocialLoginUrls(state: string): Promise<AxiosResponse<ListSocialURLs>>
  • Gets the social login urls for fb/twitter/google

    method

    getSocialLoginUrls

    async
    example
    InPlayer.Account
    .getSocialLoginUrls('123124-1r-1r13ur1h1')
    .then(data => console.log(data));

    Parameters

    • state: string

      Social login state. The state needs to be json and base64 encoded to be sent as a query parameter. Example: btoa(JSON.stringify({uuid: 'foo', redirect: 'http://example.com'}))

    Returns Promise<AxiosResponse<ListSocialURLs>>

loadMerchantRestrictionSettings

  • Return restriction settings per Merchant

    method

    loadMerchantRestrictionSettings

    async
    example
    InPlayer.Account
    .loadMerchantRestrictionSettings("528b1b80-5868-4abc-a9b6-4d3455d719c8")
    .then(data => console.log(data));

    Parameters

    • merchantUuid: string

      The merchant UUID

    Returns Promise<AxiosResponse<RestrictionSettingsData>>

    Contains the data - { "age_verification_type": "pin_code", "age_verification_enabled": true, "merchant_uuid": "3b39b5ab-b5fc-4ba3-b770-73155d20e61f", "created_at": 1532425425, "updated_at": 1532425425 }

refreshToken

  • refreshToken(clientId: string): Promise<AxiosResponse<CreateAccount>>
  • Refreshes the token

    method

    refreshToken

    async
    example
    InPlayer.Account.refreshToken('123123121-d1-t1-1ff').then(data => console.log(data))

    Parameters

    • clientId: string

      The merchant's clientId

    Returns Promise<AxiosResponse<CreateAccount>>

reportSSOtoken

  • reportSSOtoken(ssoDomain: string, token: string, deactivate: boolean): Promise<AxiosResponse<any>>
  • Reports the generated SSO token to the SSO domain.

    Parameters

    • ssoDomain: string

      The SSO domain.

    • token: string

      The token string.

    • deactivate: boolean

      Should the token be deactivated or activated.

    Returns Promise<AxiosResponse<any>>

requestNewPassword

  • Requests new password for a given user

    method

    requestNewPassword

    async
    example
    InPlayer.Account
    .requestNewPassword({
     email: "test32@test.com",
     merchantUuid: "528b1b80-5868-4abc-a9b6-4d3455d719c8",
     brandingId: 12345,
    })
    .then(data => console.log(data));

    Parameters

    • data: RequestPasswordData

      Contains { email: string, merchantUuid: string brandingId?: number }

    Returns Promise<AxiosResponse<CommonResponse>>

sendPinCode

  • sendPinCode(brandingId?: undefined | number): Promise<AxiosResponse<CommonResponse>>
  • Creates pin code and sends it to the users' email

    method

    sendPinCode

    async
    example
    InPlayer.Account.sendPinCode(1234)
    .then(data => console.log(data));

    Parameters

    • Optional brandingId: undefined | number

      Optional parametar

    Returns Promise<AxiosResponse<CommonResponse>>

setNewPassword

  • setNewPassword(data: SetPasswordData, token?: undefined | string): Promise<AxiosResponse<void>>
  • Sets new password for the user

    method

    setNewPassword

    async
    example
    InPlayer.Account
    .setNewPassword({
     password: "password",
     passwordConfirmation: "password",
     brandingId: "12345",
    }, 'afhqi83rji74hjf7e43df')
    .then(data => console.log(data));

    Parameters

    • data: SetPasswordData

      Contains { password: string passwordConfirmation: string brandingId?: number }

    • Optional token: undefined | string

      The reset token

    Returns Promise<AxiosResponse<void>>

signIn

  • Signs in the user

    method

    signIn

    async
    typedef

    {Object} AxiosResponse

    example
    InPlayer.Account.signIn({
     email: 'test@test.com',
     password: 'test123',
     clientId: '123-123-hf1hd1-12dhd1',
     referrer: 'http://localhost:3000/',
     refreshToken: '528b1b80-ddd1hj-4abc-gha3j-111111'
    })
    .then(data => console.log(data));

    Parameters

    • data: AuthenticateData

      Contains { email: string, password: string, clientId: string, clientSecret: string, referrer: string, refreshToken: string, }

    Returns Promise<AxiosResponse<CreateAccount>>

signOut

  • signOut(): Promise<AxiosResponse<undefined>>
  • Signs out the user and destroys cookies

    method

    signOut

    async
    example
    InPlayer.Account.signOut()
    .then(data => console.log(data));

    Returns Promise<AxiosResponse<undefined>>

signUp

  • Signs up/Registers user

    method

    signUp

    async
    example
    InPlayer.Account.signUp({
     fullName: "test",
     email: "test32@test.com",
     password: "12345678",
     passwordConfirmation: "12345678",
     clientId: "528b1b80-5868-4abc-a9b6-4d3455d719c8",
     type: "consumer",
     referrer: "http://localhost:3000/",
     brandingId?: 12345,
     metadata : { country: "Macedonia" },
    })
    .then(data => console.log(data));

    Parameters

    • data: SignUpData

      Contains { fullName: string, email: string password: string, passwordConfirmation: string, clientId: string, type: string, referrer: string, brandingId?: number, metadata?: { [key: string]: string }
      dateOfBirth?: string, }

    Returns Promise<AxiosResponse<CreateAccount>>

updateAccount

  • Updates the account info. Metadata fields must be from the Inplayer.getRegisterFields()

    method

    updateAccount

    async
    example
    InPlayer.Account
    .updateAccount({fullName: 'test test', metadata: {country: 'Germany'},  dateOfBirth: '1999-03-05'})
    .then(data => console.log(data));

    Parameters

    Returns Promise<AxiosResponse<void>>

validatePinCode

  • validatePinCode(pinCode: string): Promise<AxiosResponse<CommonResponse>>
  • Checks validity of pin code

    method

    validatePinCode

    async
    example
    InPlayer.Account.validatePinCode('5566')
    .then(data => console.log(data));

    Parameters

    • pinCode: string

      Code from received email message

    Returns Promise<AxiosResponse<CommonResponse>>

Generated using TypeDoc