Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InPlayer

Main class. Contains all others methods and websocket subscription

Hierarchy

  • InPlayer

Index

Constructors

constructor

  • Returns InPlayer

Properties

Account

Account: AccountType

Asset

Asset: AssetType

Branding

Branding: BrandingType

DLC

DLC: DLCType

Notifications

Notifications: NotificationsType

Payment

Payment: PaymentType

Subscription

Subscription: SubscriptionType

Voucher

Voucher: VoucherType

config

config: ApiConfig

request

request: RequestType

tokenStorage

tokenStorage: TokenStorageType = tokenStorage

Methods

isSubscribed

  • isSubscribed(): boolean
  • Checks if user is subscribed

    method

    isSubscribed

    example
       InPlayer.isSubscribed()

    Returns boolean

setConfig

  • setConfig(env: Env): void
  • Overrides the default configs

    method

    setConfig

    example
    InPlayer.setConfig('development');

    Parameters

    Returns void

subscribe

  • subscribe(accountUuid: string, callbackParams: Record<string, (...params: any) => void>): void
  • Subscribes to websocket events

    method

    subscribe

    example
    InPlayer.subscribe(
     'adsasd-d1-cjc1c-1ajaveo',
     {
      onMessage: (message) =>

    { let body = JSON.parse(message.body); console.log(body, 'message') }, onOpen: (e) => console.log('open'), onClose: (e) => console.log('close', e) } )

    Parameters

    • accountUuid: string

      The users account UUID

    • callbackParams: Record<string, (...params: any) => void>

      Methods regarding websocket { onMessage: function, onOpen: function, onClose: function }

    Returns void

unsubscribe

  • unsubscribe(): void
  • Unsubscribes from the websocket and event listeners

    method

    unsubscribe

    example
    InPlayer.unsubscribe()

    Returns void

Generated using TypeDoc